Flash Games
 FAQ   Search   Memberlist   Usergroups   Register  Profile   Log in to check your private messages   Log in 


Form Validation Help Needed Please



 

Post new topic   Reply to topic  
   DEVPPL Forum Index -> JavaScript Forum
View previous topic :: View next topic  
Author Message
chimp



Joined: 05 Dec 2006
Posts: 1

PostPosted: Tue Dec 05, 2006 8:48 am    Post subject: Form Validation Help Needed Please Reply with quote

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
Back to top
View user's profile Send private message
ngpgeeta



Joined: 18 Nov 2006
Posts: 19

PostPosted: Sun Dec 17, 2006 10:19 am    Post subject: Re: Form Validation Help Needed Please Reply with quote

<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!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    DEVPPL Forum Index -> JavaScript Forum All times are GMT + 1 Hour
Page 1 of 1

 
 
Welcome to DEVPPL.com
You are not logged in, which means that you can't post in the forums.
Click here to Register

If you are a current member here on DEVPPL, please login below:

User: Pass:
Log me on automatically each visit:

 


Powered by phpBB © 2001, 2005 phpBB Group - Modified by DEVPPL

Flash Games - Sitemap