View Single Post
  #7 (permalink)  
Old February 18th, 2009, 04:08 PM
zeronexxx zeronexxx is offline
Authorized User
 
Join Date: Dec 2008
Location: London
Posts: 50
Thanks: 1
Thanked 5 Times in 5 Posts
Default

Hi Bill

I am afraid that what you have expressed above clearly is not the case, following is the actual code. I downloaded the code and here is the full code.

PHP Code:
<html>
    <
head>
        <
title>E-mail Example</title>
        <
script type="text/javascript">
    

                function 
isValidEmail(sText) {
                    var 
reEmail = /^(?:\w+\.?)*\w+@(?:\w+\.)+\w+$/;
                    return 
reEmail.test(sText);
                }

                
                function 
validate() {
                    var 
oInput1 document.getElementById("txt1");
                    if (
isValidEmail(oInput1.value)) {
                        
alert("Valid");
                    } else {
                        
alert("Invalid!");
                    }

                }
        
</script>
    </head>
    <body>
        <p>E-mail Address: <input type="text" id="txt1" /><br />
        <input type="button" value="Validate" onclick="validate()" /></p>
       
    </body>
</html> 
Hopefully the confusion is clear now?

Regards
Reply With Quote
The Following User Says Thank You to zeronexxx For This Useful Post:
williamjwayne (February 18th, 2009)