c# - Use Jquery's jConfirm like JS's confirm method -
i have anchor on click of want call jquery's jconfirm
method , having problem in using directly confirm
method in javascript
<a id="ctl00_cphmain_lnkdeleteimage" name="ctl00$cphmain$lnkdeleteimage" onclick="return confirm('are sure ?');">test</a>
and in jquery doing this
<a id="ctl00_cphmain_lnkdeleteimage" name="ctl00$cphmain$lnkdeleteimage" onclick="return jconfirm('are sure?', 'update test')">test</a>
i want anchor click occur when user selects ok
in confirm window
currently have done in asp.net
function confirmwindow() { jconfirm("are sure?", "update test", function(r) { if (r == true) { __dopostback("ctl00$cphmain$lnkdeleteimage", ""); } }); return false; } <a onclick="return confirmwindow()" id="ctl00_cphmain_lnkdeleteimage" name="ctl00$cphmain$lnkdeleteimage" >test</a>
you can't. javascript/dom confirm
dialog modal, means halts script execution , user interaction until user responds clicking button in confirm dialog.
jconfirm, however, javascript implementation overlays current page content more content, it's not modal because can't halt script execution without blocking user interaction "dialog" itself. means has return function before user can respond confirm dialog , that's why callback function required instead.
Comments
Post a Comment