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="\"/_layouts/images/addressbook.gif\"" alt="Browse" />
<pre>" // Append the innerHTML with display:none
}
}
}
Calculate number of weekdays between two date fields
Great post on calculating number of weekdays between two date fields
http://social.technet.microsoft.com/Forums/en-US/sharepointgeneral/thread/d71cb2b8-72f7-4b9f-a5c9-7c08a9ccf6c9/
Columns from SharePoint list are missing ( Created or Modified) in SharePoint 2010
Both Created and Modified columns went missing in my site collection. I found the solution here :
http://sharepointtechie.blogspot.com/2010/04/created-and-modified-field-went-missing.html
Change the File Upload Size limit in SharePoint
- Log in to SharePoint Server and navigate to Central Administration.
- On the Central Administration Page navigate to Central Administration -> Application Management -> Manage Web Applications
- Highlight the web application
- Once there highlight the web application that you want to change and then click on General Settings
- On General Settings dialog, scroll to the bottom of the list and you will see the maximum upload size the default is 50MB
- Update that to the new size
- Click OK
Create a list in all the sites using Powershell
Here is way to create a list based on a custom template using Powershell. The script will go through each site and create the list and add them to the Quick Launch
$GetSites = Get-SPWebApplication | Get-SPSite | Get-SPWeb -Limit ALL
foreach($getsite in $GetSites)
{
$listTemplate = $getsite.Site.GetCustomListTemplates($getsite)
$getsite.Lists.Add("MyList","My List",$listTemplate["MyTemplate"])
$list = $getsite.Lists["MyList"]
$list.OnQuickLaunch = $true
$list.Update()
}
Make sure that custom template is uploaded in the List Template Gallery. Check out this link if you want to add a list template using powershell
Add List Template to all the site collections using Powershell
Here is a way to upload a list template to all the site collections. Instead of going to all the site collections and upload the template manually .. use the script below to add them using Powershell
$GetSiteCollections = Get-SPWebApplication | Get-SPSite -Limit ALL
## Add the List Template to the all the Site Collections
foreach($GetSiteCollection in $GetSiteCollections)
{
$web = $GetSiteCollection.OpenWeb();
$spfolder = $web.getfolder("_catalogs\lt")
$spfileCollection = $spfolder.Files
$file = Get-Item c:\Temp\MyListTemplate.stp
spfileCollection.Add"MyListTemplate.stp", $file.OpenRead(),$true)
}
Thanks
Copy value from column to another using JQuery
Copy the value from one column to another column on a New List Item Form.
In this example, I am populating the End Date Field with the Start Date Field value when user is filling out a meeting request form in SharePoint.
Add the following code on the page under “PlaceHolderMain” tag.
<script type="text/javascript" src="../../Shared Documents/Javascript/jquery/jquery.js">
$(document).ready(function(){
var strStartDate = $("input[title='Start Date']");
strStartDate.focusout(function()
{
$("input[title='End Date']").val(strStartDate.val());
});
});
</script>

