You are here: DEVPPL Forum Programming JavaScript Forum
NOTIFICATIONS
54.078
MEMBERS
15.681
TOPICS
62.250
POSTS
  562
FLASH GAMES
7.740
TUTORIALS
 

Login

E-mail:
Password:

Form Validation Help Needed Please

0

Loading

Form Validation Help Needed Please

Postby Chimp » Tue Dec 05, 2006 8:48 am

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
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

Login to get rid of ads

 

0

Loading

Postby Ngpgeeta » Sun Dec 17, 2006 10:19 am

<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!
Ngpgeeta
 
Reputation: 0
Posts: 19
Joined: Sat Nov 18, 2006 12:30 pm
Highscores: 0
Arcade winning challenges: 0
^ Back to Top