Hello all, I am trying to use js to add an item entry to a sharepoint list here is my code below... This issue is that the button is not firing and when it did the code would skip down to the onQueryFailed message. can anyone point me in the right direction? thanks in advance
siteUrl = 'http://portal/Pages/Login.aspx';
function updateListItem() {
var clientContext = new SP.ClientContext(siteUrl);
var oList = clientContext.get_web().get_lists().getByTitle('http://portal/Lists/Participant/AllItems.aspx');
this.oListItem = oList.getItemById(4);
oListItem.set_item('codetest', 'My Updated Title');
oListItem.update();
clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));
}
function onQuerySucceeded() {
alert('Item updated!');
}
function onQueryFailed(sender, args) {
alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
}