Tuesday, July 17, 2012

Inserting values into SharePoint list using Custom page

Function: $().SPServices
Web Service: Lists
Operation : UpdateListItems
$(document).ready(function() {
$("#fdbsubmit").click(function(){
var subject = $("#fdbsubject").val();
var message = $("#fdbmessage").val();
CreateNewItem(subject, message);
});
});
function CreateNewItem(subject, message)
{
$().SPServices({
operation: "UpdateListItems",
async: false,
batchCmd: "New",
listName: "feedback",
valuepairs: [["Title", subject], ["Message", message]],
completefunc: function(xData, Status)
{
alert("insertion completed");
}
});
}

No comments:

Post a Comment