<script>
function checkemail(){
//var testresults
var str=document.getElementById('emailsub').value;
var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
if (filter.test(str))
{
//testresults=true
return newsletter() // this to call another javascript function
return true;
}
else{
alert("Please input a valid email address!")
//testresults=false
return false;
}
//return (testresults)
}
</script>
Refer : http://www.javascriptkit.com/script/script2/acheck.shtml
0 comments:
Post a Comment