Trisha Trisha - 3 months ago 7
Javascript Question

stop page from loading after dialog box opens

What I'm trying to do is have a contact form, and when the user hits submit a dialog box appears asking the user to confirm yes/no, and the form should not submit until the user has selected yes, or stays on the page when selects no.


What my issue is, once the dialog box opens, the form still submits, and the dialog box is open for only a second or so.


So is it possible to stop the page from loading until after the dialog box is closed or yes is clicked?

I'm using the jQuery Impromptu plugin for the dialog box.

Answer

Don't use type="submit", just use type="button". Submit the form from your own code based on the dialog result.

Comments