Results 1 to 2 of 2
Related
-
Problem With form validation of Postal Code Forum: Javascript Forum
Replies: 3 -
Hey All!! I have a validation problem, can you help!! Forum: HTML Forum
Replies: 4 -
Help with Javascript form validation please!! Forum: Javascript Forum
Replies: 2 -
Form validation - please help! Forum: Javascript Forum
Replies: 3
-
12-05-2006, 03:11 AM #1
Form Validation Help Needed Please
I am knew here so hi to everyone, I have been told by a friend that this site is particularly helpful so here goes.
I have a form that i want to ensure is filled out correctly before the user is able to proceed. I am also advised that Javascript is the easiest way to do this, however i have no idea how to implememnt it.
http://chimp.cc/start.htm
If the user fails to fill out the terms and conditions box with a "Yes"when the user clicks submit, i want a message to pop up to tell them to complete it.
and to return the user to that field for completion.
I honestly have no idea how to do this, can someone please help me.
I have attached the source code too.
Cheers
Andy
-
12-07-2006, 02:41 AM #2
Re: Form Validation Help Needed Please
It looks like you already have something?
anyway if you dont, all you need to do is use:
document.getElementById('id_goes_here').value to get what the items value is...
then do an if statment to see if it fitts your needs
then in the <form> tag make an element called 'onsubmit="return yourfunction()"' then have that function do a "return true" if the form is acceptable, and "return false" if it is not. and if you want to add a little message use alert() function http://www.wikijs.com/index.php?title=Alert
if you return false to a onsubmit it will not submit the page.
-ALL
Cloudjiffy- PaaS for Developers
10-05-2020, 12:30 AM in Web Hosting Forum