It is currently Fri Jul 30, 2010 2:10 pm


All times are UTC [ DST ]


Ask on Codemiles community and get answers Free and Fast :

HTML,DHTML,Javascript,XML,CSS

Our guest share with us your code snippets , your programming problems , your open source projects ,read articles and post yours .







Post new topic Reply to topic  [ 1 post ] 
  Print view Previous topic | Next topic 
Author Message
 Post subject: Form Validation Problem
PostPosted: Mon Aug 17, 2009 1:16 pm 
Offline
Newbie
User avatar

Joined: Fri Jun 26, 2009 5:50 am
Posts: 23
Has thanked: 0 time
Have thanks: 0 time

Hi,
I am trying to validate a form, and am getting the error messages as needed, but it submits the form anyway.

Here is the Java:

function validate (form){

var returnValue = true;

var email = CSLavRequestForm.email.value;
var phone = CSLavRequestForm.phoneNumber.value;
var groupName = CSLavRequestForm.workshopName.value;

if (email.length < 6){
returnValue = false;
alert("Please Enter Valid email");
CSLavRequestForm.email.focus();
}
if (phone.length < 10){
returnValue = false;
alert("Please Enter Valid Phone Number");
CSLavRequestForm.phone.focus();
}
if (groupName.length < 3){
returnValue = false;
alert("Please Enter Valid Workshop/Region");
CSLavRequestForm.groupName.focus();
}

return returnValue;
}
</script>

and the form line in the html:

<form onsubmit="return validate(this);" action="/cgi-sys/formmail.pl" method="post" name="CSLavRequestForm" id="CSLavRequestForm" >


I am stuck! Benn working on this for way too long

_________________
Thanks & regards
Lokananth
[url "http://www.mioot.com"]Live Chat Software[/url] By miOOt


TOP
 Profile Send private message  
 
| More
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 


 Similar topics
 Topic title   Forum   Author   Replies 
 Javascript Form Calculation Error :banghead:  Scripting Language  solarfinder  0
 calling method to form- displaying textbox data in messagbox  C#  jackjones2  1
 FeedBack form Spam  General Discussion  AskBot  2
 I'm having a problem creating a Javascript form. Whats wrong  Scripting Language  mspink1  1
 Please help me in the form field  Scripting Language  bimalnayak  1

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  





Home
General Talks
Finished Projects
Code Library
Games
Tutorials

Java
C/C++
C-sharp
php
Script
JSP/Servlets
Ajax
ASP/ASP.net
Google SEO
Database
Communications
Phpbb3 styles
Photoshop tutorials
Flash tutorials
Find a job






Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2009
mileX v1.0 designed by codemiles team