Results 1 to 2 of 2
Hey All!! I have a validation problem, can you help!! Forum: HTML ForumReplies: 4
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.
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.
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.