jQuery and Sharepoint web services - add a list item

This is a very basic tutorial in how to add list items using SharePoint and jQuery. Some prerequisites to understand what is happening. The main items to observe are:
  • xhr.setRequestHeader that you can get from the web services page (see bellow)
  • in the SharePoint' list you need two columns Title and Description
  • the browser alert window will return some information that you could remove after testing
  • after posting the information in the list it will run the processResult function where you can do some fancy user feedback

Html with the fields to be edited by the user
Title: 
Description: 

In the SharePoint web services description you can extract the value for the xhr.setRequestHeader variable invoking /_vti_bin/lists.asmx?op=UpdateListItems, here is an example:
POST /_vti_bin/lists.asmx HTTP/1.1
Host: www.ausinnovation.org
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://schemas.microsoft.com/sharepoint/soap/UpdateListItems"





string

schemaxml



0 comments :: jQuery and Sharepoint web services - add a list item