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!
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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!
It's a toss of a coin really ;-) so i'll split the points, cheers!
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