jasonpc1
05-30-2011, 10:15 PM
<script type="text/javascript">
function checkEmailValid(email) {
s = email.indexOf(' ') + 1;
e = email.indexOf('@') + 1;
f = email.indexOf('.') + 1;
if ( email != '' && s == 0 && e && f > e + 1 && f < email.length) {
return true;
} else {
return false;
}
}
</script>
this would allow i.e.
1@1.1
a@a.a
or any number of characters before and after the @ and the .
i have tried the regular expresions but these failed for us with various email address so opted for this which work in the javascript version but we now need to use this in PHP on the server side to validate before it is used.
function checkEmailValid(email) {
s = email.indexOf(' ') + 1;
e = email.indexOf('@') + 1;
f = email.indexOf('.') + 1;
if ( email != '' && s == 0 && e && f > e + 1 && f < email.length) {
return true;
} else {
return false;
}
}
</script>
this would allow i.e.
1@1.1
a@a.a
or any number of characters before and after the @ and the .
i have tried the regular expresions but these failed for us with various email address so opted for this which work in the javascript version but we now need to use this in PHP on the server side to validate before it is used.