By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,818 Members | 2,089 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,818 IT Pros & Developers. It's quick & easy.

Click (alert) then submit

P: 2

Only new to javascript., and most of my learning is from browsing for hints - but can't find an answer to this one.

I have an order form designed for my business, that runs a series of javascript statements for validation etc. However I want to add an event on submission, that comes up with a box confirming the order is about to be submitted once OK is pressed. I figured that I could somehow combine my onsubmit with an onclick, but not exactly sure how to do it. Can somebody help out?

Jul 17 '08 #1
Share this Question
Share on Google+
3 Replies

P: 77
Your necessary is "
event onsubmit used to show a box dialog to confirm...
than what your business with onclick event??
Jul 17 '08 #2

P: 13,264
Just treat the confirmation as another validation step and call it as the last of the validation steps the same way you were calling the other validations.
Jul 17 '08 #3

Expert Mod 15k+
P: 16,027
If you're calling the validation function in the correct manner, it could look something like this:
Expand|Select|Wrap|Line Numbers
  1. if (!confirm("whatever confirmation message you want to put here...")) return false;
  2. return true;
Jul 17 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.