I have a form that is being valdiated with jQuery validate plugin. On clicking submit, and after form has been succesfully validated, I want a dialog confirmation to appear, then on clicking OK, the form submits.
See my code below. The Dialog opens fine. Dialog works fine, but the form does not submit when OK is clicked. My guess is the .submit() call is sending the process back into the validate() process, causing some kind of loop, but I can't think of any other way to do this. Any suggestions on what I am doing wrong here will be greatly appreciated. =========================================================== // Initialize Dialog Box $('#dialog').dialog({ autoOpen: false, width: 400, modal: true, title: 'Confirm Purchase of Credit.', close: function() {$('#dialog p').empty();}, buttons: { "Ok": function() { $("#purchase_credit").submit (); $('#dialog p').empty(); }, "Cancel": function() { $(this).dialog("close"); $('#dialog p').empty(); } } }); // dialog being opened from validate() using the submithandler. submitHandler: function(form) { $('#dialog p').append('Click \'OK\' to confirm Purchase of $' + $("#cc_amount").val() + ' Credit.<br><br>This amount will be charged to the Credit Card Entered.'); $('#dialog').dialog('open'); } note this message quoted from j...@oz