Hi...
I am having problem with my script, I just added the email validation script and it does not work with the standard
one...
please help...
<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1255">
<title>Send email</title>
<script language="javascript" type="text/javascript">
<!-- hide script from older browsers
function validateForm(validation)
{
if(""==document.forms.validation.fname.value)
{
alert("Please enter first name");
document.forms.validation.fname.focus();
return false;
}
}
stop hiding script -->
</script>
<script language="JavaScript1.2">
var testresults
function checkemail(){
var str=document.validation.emailcheck.value
var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
if (filter.test(str))
testresults=true
else{
alert("Please input a valid email address!")
testresults=false
}
return (testresults)
}
</script>
<script>
function checkbae(){
if (document.layers||document.getElementById||document.all)
return checkemail()
else
return true
}
</script>
</head>
<body>
<form name="validation" onSubmit="return validateForm(); checkbae();">
<p>First Name:<br>
<input type="text" size=18 name="fname"> </p>
<p>Please input a valid email address:<br>
<input type="text" size=18 name="emailcheck">
<input type="submit" value="Submit">
</p>
</form>
</body>
</html>
I am having problem with my script, I just added the email validation script and it does not work with the standard
one...
please help...
<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1255">
<title>Send email</title>
<script language="javascript" type="text/javascript">
<!-- hide script from older browsers
function validateForm(validation)
{
if(""==document.forms.validation.fname.value)
{
alert("Please enter first name");
document.forms.validation.fname.focus();
return false;
}
}
stop hiding script -->
</script>
<script language="JavaScript1.2">
var testresults
function checkemail(){
var str=document.validation.emailcheck.value
var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
if (filter.test(str))
testresults=true
else{
alert("Please input a valid email address!")
testresults=false
}
return (testresults)
}
</script>
<script>
function checkbae(){
if (document.layers||document.getElementById||document.all)
return checkemail()
else
return true
}
</script>
</head>
<body>
<form name="validation" onSubmit="return validateForm(); checkbae();">
<p>First Name:<br>
<input type="text" size=18 name="fname"> </p>
<p>Please input a valid email address:<br>
<input type="text" size=18 name="emailcheck">
<input type="submit" value="Submit">
</p>
</form>
</body>
</html>