jquery - Add a confirmation dialog to ASP MVC view -


i want have dialog box popup letting user know of consequences when hitting continue button, preferably styled better standard browser popup.

i got jqdialog, jquery plugin, , solution:

i have view following html:

<form id="formsubmit" action="<%= resolveurl("~/summary/summary") %>" method="post">    <input type="button" name="summarybutton" id="bt-confirm" value="continue »" /> </form> 

and i've bound click event button jquery:

    $('#bt-confirm').click(function () {         $.jqdialog.confirm("are sure want continue?",                 function () { callsubmit(); },  // callback function 'yes' button                 function () { alert("this intrusive alert says clicked no"); }  // callback function 'no' button             );     }); 

my callsubmit() gets called, form not submitted:

  function callsubmit() {       var submiturl = '<%= resolveurl("~/summary/summary") %>';       alert(submiturl);        document.formsubmit.submit();   // not posting controller             } 

is there better/easier way this? wrong jquery submit?

any appreciated.

try replacing:

document.formsubmit.submit(); 

with:

$('#formsubmit').submit(); 

Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -