Reputation: 12711
below is only a part of my javascript code. confirmation message is not firing.
function PKId_delete_formatter(cellvalue, options, rowObject) {
return '<a href="JqGridClients/Delete?id=' + cellvalue + '" onclick="return confirm("Are you sure want to delete?");" class="ui-icon ui-icon-trash"></a>';
}
I think the above code is enough, please let me know if more code is needed
Upvotes: 0
Views: 662
Reputation: 50905
Use this:
return '<a href="JqGridClients/Delete?id=' + cellvalue + '" onclick="return confirm(\'Are you sure want to delete?\');" class="ui-icon ui-icon-trash"></a>';
It inserts the proper quotes for the confirm
.
DEMO: http://jsfiddle.net/BS5u6/1/
Upvotes: 1