Posted by -Lost on 02/18/07 06:36
"chadlupkes" <chadlupkes@gmail.com> wrote in message
news:1171779081.479141.299610@q2g2000cwa.googlegroups.com...
>I have this code from someone else, and I'm trying to make heads or
> tails of it because IE doesn't like it. Can anyone help? Or does
> anyone have a better idea?
>
> /* parse the email to check for valid form */
> function parseemail(str)
> {
> str = trim(str);
> <?if(preg_match("/MSIE 5.0;/", $_SERVER['HTTP_USER_AGENT'])) // this
> is IE 5.0
> {?>
> if(str.search(/\w+@[\w\W]+\.[a-z]{3}/) == -1)
> {
> window.alert("Please enter a valid email address");
> return true;
> }
> <?}else{ // not IE 5.0
> ?>
> if(str.search(/^[\w\-\.]+[@][\w\-]+(?:\.[\w\-]+)+$/) == -1) // ||
> str.search(/.+?\@([\w.-]+?\s)/) == -1)
> {
> window.alert("Please enter a valid email address");
> return true;
> }
> <?}?>
> }
I swear this looks like PHP and JavaScript.
-Lost
[Back to original message]
|