Trisha Trisha - 1 year ago 75
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 Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download