This project has moved. For the latest updates, please go here.

How to get current site name and set it as SharePoint list field value?

Aug 16, 2012 at 9:57 AM

  Is it possible to do this with jQuery and SPServices? If so, any links or examples will be appreciated. Thanks in advance.

Aug 16, 2012 at 12:30 PM

I was able to found a simple answer for my question:

 $(document).ready(function() {
 var thisSite = $().SPServices.SPGetCurrentSite();
 alert (thisSite);
 $('input[title="Site name"]').val(thisSite);


Where thisSite - variable which store current site value, Site name - display name of single line or text form SharePoint field