javascript - confirmation message is not firing a href onclick -


below part of javascript code. confirmation message not firing.

 function pkid_delete_formatter(cellvalue, options, rowobject) {     return '<a href="jqgridclients/delete?id=' + cellvalue + '" onclick="return confirm("are sure want delete?");" class="ui-icon ui-icon-trash"></a>'; } 

i think above code enough, please let me know if more code needed

use this:

return '<a href="jqgridclients/delete?id=' + cellvalue + '" onclick="return confirm(\'are sure want delete?\');" class="ui-icon ui-icon-trash"></a>'; 

it inserts proper quotes confirm.

demo: http://jsfiddle.net/bs5u6/1/


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -