Reputation: 1718
I am using Jquery Datatables, and have to have confirmation scripts in certain cells. However, since the use of ' causes the script to not fire (' within '), how can I get around this? Example below (the onclick event won't fire, I get sent to the link immediately).
var dataSet = [["<a href='member_search.aspx' onclick='return confirm('Please confirm?'); return false;' class='btn btn-danger btn-xs'>radera</a>", "Test1", "Test1", "Test1", "<a href='member_details.aspx'>info</a>"]]
Upvotes: 1
Views: 45
Reputation: 194
i will use this code and run properly , plz try ..
OnClientClick='<%# string.Format("javascript:return confirm(\"Do you want to do this : {0}\")", Eval("ID")) %>'>
Thank you
Upvotes: 0
Reputation: 85558
Just use "
:
onclick='return confirm("Please confirm?"); return false;'
http://jsfiddle.net/0f9Ljfjr/962/
Upvotes: 0
Reputation: 17940
You need to escape the extra quotes:
onclick='return confirm(\'Please confirm?\')
Upvotes: 1