| You are here: DEVPPL ‹ Forum ‹ Programming ‹ JavaScript Forum |
NOTIFICATIONS
|
|
|||||||||||||||
Login |
Form Validation Help Needed Please
2 posts
• Page 1 of 1
0
Form Validation Help Needed Please
I am new 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.
Cheers
Andy
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.
Cheers
Andy
- Chimp
- Reputation: 0
- Posts: 1
- Joined: Tue Dec 05, 2006 8:44 am
- Highscores: 0
- Arcade winning challenges: 0
Form Validation Help Needed Please - Sponsored results
- Sponsored results
0
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
</HEAD>
<script>
function checking()
{
var v=document.f1.accept.value
if(v=="yes")
return true
else
{
alert("Form will be submitted only if the terms and conditions are accepted.")
return false
}
}
</script>
<BODY>
<form name="f1" action="something" onsubmit="return checking()">
Please type in Yes to say you have read and agree to the terms and conditions <input type=text" name="accept" value=""><br>
<input type="submit" value="submit">
</form>
</BODY>
</HTML>
Hope this helps!
<HEAD>
<TITLE> New Document </TITLE>
</HEAD>
<script>
function checking()
{
var v=document.f1.accept.value
if(v=="yes")
return true
else
{
alert("Form will be submitted only if the terms and conditions are accepted.")
return false
}
}
</script>
<BODY>
<form name="f1" action="something" onsubmit="return checking()">
Please type in Yes to say you have read and agree to the terms and conditions <input type=text" name="accept" value=""><br>
<input type="submit" value="submit">
</form>
</BODY>
</HTML>
Hope this helps!
- Ngpgeeta
- Reputation: 0
- Posts: 19
- Joined: Sat Nov 18, 2006 12:30 pm
- Highscores: 0
- Arcade winning challenges: 0
|
|