Hi got an issue with my script and FF. I use the folowing code for validation but it doesn't work for me using FF, works fine with IE.
All help is appreciated!
Glen
Code:
function checkemail() {
var check = document.form
var one = new Array("com", "edu", "net", "ca", "org")
if(check.email.value == "") {
alert("Please enter your email address");
check.email.focus();
return false;
}
if(check.email.value.indexOf("@") == -1 || check.email.value.lastIndexOf(".") == -1) {
alert("Error in EMail Address");
check.email.select();
return false;
}
var bOK = false;
for(i=0; i<=one.length; i++) {
if(check.email.value.indexOf("." + one[i]) > -1) {
bOK = true;
}
}
if (!bOK) {
alert("Error in EMail Address");
check.email.select();
return false;
}
if(check.email.value.indexOf("@") < 2) {
alert("Error in EMail Address");
check.email.selecy();
return false;
}
document.getElementById('test1').style.display='none';
document.getElementById('thankyou').style.display='block';
}{/code]
the form is written like this;
[code]
<div id = "test1" align = "center"> <h2> Enter your Email Address for a <span style = "color:orange;">Free Clinic Draw</span> </h2>
<form name="form" method="post" action = "mailto:draw@ezrasoccer.com?subject=Free draw" onSubmit="return checkemail();">
<input type="text" name="email"><br><br>
<input type="submit" name="Submit" value="Enter Draw">
</form>
</div>
<div align ="center" id='thankyou' style="display:none; color:red; font-size:larger;">
Your Email Address Has Been Entered.<br/>
Good Luck!!
</div>
Glen