<script src="../../../_layouts/Gridwebpart/jquery-1.6.3.js" type="text/javascript"></script>
<script src="../../../_layouts/Gridwebpart/jquery.SPServices-0.7.2BETA1.js" type="text/javascript"></script>
<SharePoint:FormDigest ID="FormDigest1" runat="server" />
<script type="text/javascript">
$(document).ready(function () {
//GetKeywordList();
});
function AddNewSPListItem() {
alert($('#<%=txtName.ClientID %>').val());
var Title = $('#<%=txtName.ClientID %>').val();
var Description = $('#<%=txtDescription.ClientID %>').val();
alert(Title);
$().SPServices({
operation: "AutocompleteKeywordList",
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='TopNumber'>1</Field>" +
"<Field Name='Title'>" + Title + "</Field>" +
"<Field Name='Description'>" + Description + "</Field>" +
"</Method>" +
"</Batch>",
completefunc: function (xData, Status) {
alert("success");
}
}); //End SPSErvices
}
</script>
ERROR
have alert(Title); its undefined will val() work in sharepoint