We help IT Professionals succeed at work.

how can I make a confirmation before trigger the submit of a buttom?

hidrau
hidrau asked
on
Medium Priority
340 Views
Last Modified: 2012-06-27
Hello guys

I have a buttom and I need to make a confirmation before trigger the form submit.

is there any way to do that in the button? If my confirmation is not, It must cancell the submit.

thanks
Comment
Watch Question

Multitechnician
CERTIFIED EXPERT
Distinguished Expert 2019
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Roman GhermanSenior Software Engineer

Commented:
return false if you want to cancel the submit:

<input type="submit" onclick="return false;" value="Submit" />

Open in new window

Author

Commented:
thanks very much
leakim971Multitechnician
CERTIFIED EXPERT
Distinguished Expert 2019

Commented:
function validate {
   //validate
   // if a test fail return false
   //
   // finally :
   return true; // by default return true to submit the form
}

Open in new window

leakim971Multitechnician
CERTIFIED EXPERT
Distinguished Expert 2019

Commented:
You're welcome! Thanks for the points!
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.