View Full Version : Form Validation Javascript Help

01-09-2007, 04:46 AM
G'day ppl,

I have just found a form validation script and all is working fine
the only thng is that in my form i have a drop menu and i cant figure out how to get this to work.

the script so far is.

<script language="JavaScript"> function formCheck()
if (document.JFCSMS.SURNAME.value == "")
alert("Please enter SURNAME.");
return false;
if (document.JFCSMS.NAME.value == "")
alert("Please enter NAME.");
return false;

if( isNaN(document.JFCSMS.MOBILE NUMBER.value) )
alert('Please enter a vaild Mobile Number!');
document.JFCSMS.MOBILE NUMBER.focus();
return false;
if (document.JFCSMS.MOBILE NUMBER.value == "")
alert("Please enter Mobile Number.");
document.JFCSMS.MOBILE NUMBER.focus();
return false;


<form name="JFCSMS" method="post" action="cgi-bin/FormMail.pl" onsubmit="return formCheck()">
<input type=hidden name="recipient" value="email@myserver.com.au">
<p><span style="font-size:9pt;"><font face="Arial"><input type="text" name="SURNAME"><br>
</font><font face="Arial" color="black">Given Name:<input type="text" name="NAME"><br>
Mobile Number:</font><font face="Arial"><input type="text" name="MOBILE NUMBER"><br>
</font><font face="Arial" color="black">Relation to JFC:</font></span><br>
<select name="RELATION TO JFC" size="1">
<option selected value>- - - - - - - - -</option>
<option>Past Player</option>
</select><br><input type=hidden name="title" value="JFC SMS Registration">
<br><input type=hidden name="redirect" value="http://www.myserver.com.au/thanks.html">
<input type="submit" name="SUBMIT" value="Submit"> <input type="reset" name="RESET" value="Clear"></form>

If anyone can help me that would be great Thanks


01-09-2007, 06:00 AM
DW i fixed the problem