Link to home
Start Free TrialLog in
Avatar of Dustballs
Dustballs

asked on

Javascript PopUp message on a form submit

I have a form on a php page, and all i simply want is when a user clicks "submit" it brings up  a PopUp message / error.
I have gone through the site and for some reason have not found a simple solution.
So basically, when a user clicks the submit button, I want it to display a popup with a message and two buttons like ...
Are you sure you want to continue?
if "Yes" .... go to this page
if "No" .... close the popup and return to the same page

Thanks!
ASKER CERTIFIED SOLUTION
Avatar of Sinoj Sebastian
Sinoj Sebastian
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of b0lsc0tt
@Frosty555

Sinoj's suggestion of doing it in the form tag with the onsubmit event will work.  The "thoughts" you shared in your comment on its benefits are correct.  I recommend doing it in the onsubmit event in the form tag although there is nothing wrong with the way you suggested it.

I hope this helps. :)  Let me know if you have any questions or need more information.

b0lsc0tt
Avatar of Dustballs
Dustballs

ASKER

I've tried both ways and I think they work the exact same, I don't notice any difference. Both of them will work if the user hits return after entering data in any textbox in the form.
It's a toss of a coin really ;-) so i'll split the points, cheers!