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

php - cannot display multiple markers in google maps v3 from traceroute result -

php - Boolean search on database with 5 million rows, very slow -

css - Text drops down with smaller window -