submit form after confirmation by jquery dialog for payment -


i have book submit button payment gateway.

the dialog box not staying submitting form without confirming.

how stop submitting form.

here code :

var submitform = $('#paypal'); submit = false;  $("#confirm").dialog({     resizable: false,     height: 140,     modal: true,     autoopen: false,     buttons: {         'submit': function() {             $(this).dialog('close');             submit = true;             submitform.submit();         },         'cancel': function() {             $(this).dialog('close');         }     } }); $("#confirm").parent().appendto($("#paypal"));   submitform.submit(function() {     if (submit) {         return true;     } else {         $("#confirm").dialog('open');         return false;     } }); 

html code hidden values removed:

<form id="paypal" name="paypal" method='post' action="https://www.sandbox.paypal.com/cgi-bin/webscr"> <input type="submit" class="book_nowinp" value="book_now" name="btnbook"/>          </form> 

dont use submit button in form, use normal button instead , open confirm dialog onclick of button.

<input type="button" class="book_nowinp" onclick="$('#confirm').dialog('open')" value="book_now" name="btnbook"/> 

you have code trigger form submit on onclick event of submit button of dialog, remove handler on form submit.


Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -

c# - String.format() DateTime With Arabic culture -