Archive

Posts Tagged ‘SharePoint Designer 2010’

March 27, 2012 Leave a comment

Recently I  came upon a requirement where the client  wanted the People Picker field to populate automatically with a user name depending on the some criteria and  not be able to change it.
I know I can disable the field but with the “Browse” icon a user can still change the People Picker value.
 So in order to hide the “Browse” field I went on a journey to figure out and finally found an easy way …
var divs1 = document.getElementsByTagName('a');    // Locate the "a" tag on the page
var z = 0;
for(var i =0; i < divs1.length; i++) //Loop through to find the browse icon
{
if(divs1[i].<a class="zem_slink" title="Internet Explorer" href="http://www.microsoft.com/windows/internet-explorer/" rel="homepage" target="_blank">innerHTML</a>.indexOf('addressbook.gif') > 0) // The name of the image is "addressbook.gif"
{
z++
if (z == 3)  // you have to manually count the total number of PeoplePicker on the page and target the one you want to disable
{
divs1[i].innerHTML = "</pre>
<img title="Browse" src="\&quot;/_layouts/images/addressbook.gif\&quot;" alt="Browse" />
<pre>"   // Append the innerHTML with display:none 
}
}
}

Comments History not showing on Custom Display Form

April 4, 2011 2 comments

Creating Custom Display Form in SharePoint Designer for a List does not show history for Comments field by default.
Here is the fix for that:

Replace:

<xsl: select=”@V3Comments” value-of disable-output-escaping=”yes”  />

Add:

<SharePoint:AppendOnlyHistory runat=”server” ControlMode=”Display” FieldName=”V3Comments” ItemId=”{@ID}”  />

This should fix the issue and start showing all the comments added in the Comments Field.