PixSearchNG

Set Sharepoint List Guid to a SPList Field with jQuery:

1.Create a List Item called 'GUID' with Format Text:

2. Open List in SP Designer and edit NewForm.aspx of the List in advanced mode (right click link)

3. Edit the following Code after Contenplaceholder Main 

4. Reference or implement jQuery and SPServices properly from Set Sharepoint List Guid to a List Field with jQuery http://spservices.codeplex.com

<asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server">
<script type="text/javascript" src="/Scripts/jQuery-1.11.0.js"></script>
<script type="text/javascript" src="/Scripts/jquery.SPServices-2014.01.js"></script>
<script type="text/javascript">
    $( document ).ready(function() {		
		
		//Call GetList id Function with Name of the list
		var listid = GetListId("KTM Tasks");
		
		function SetGUIDfield(listID) { 
				//Set Input Field GUID and disable it
				$('input[title="GUID"]').val(listID);	
				$('input[title="GUID"]').attr("disabled", true);						
		}
		
		//Retrieve GUID of the List
		function GetListId(listName) {
			var id = "";
			$().SPServices({
			operation: "GetList",
			listName: listName,
			async: false,
			completefunc: function (xData, Status) {
			id = $(xData.responseXML).find("List").attr("ID");
			}
			});
			return id;
		} 
		
		SetGUIDfield(listid);				
	});
			
</script>