function AddNewSPListItem() {
alert($('#<%=txtName.ClientID %>').val());
var Title = $('#<%=txtName.ClientID %>').val();
var Description = $('#<%=txtDescription.ClientID %>').val();
alert(Title);
$().SPServices({
operation: "UpdateListItems",
async: false,
webURL: window.location.protocol + "//" + window.location.host,
listName: "GridList",
updates: "<Batch OnError='Continue' PreCalc='TRUE'>" +
//Cmd = 'New' is a command to add new record in the list.
"<Method ID='1' Cmd='New'>" +
"<Field Name='Title'>" + Title + "</Field>" +
"<Field Name='Description'>" + Description + "</Field>" +
"</Method>" +
"</Batch>",
completefunc: function (xData, Status) {
alert("success");
}
}); //End SPSErvices
}
EXPLAINATION: There was no fieldname called "Field Name='TopNumber'>1 Field" + So the whole operation was failing.
Also instead of operation: "AutocompleteKeywordList", it should be operation: "UpdateListItems",