why doesnt this javascript work?

Discussion in 'OT Technology' started by D1G1T4L, May 31, 2004.

  1. D1G1T4L

    D1G1T4L Active Member

    Joined:
    May 4, 2001
    Messages:
    16,489
    Likes Received:
    0
    Location:
    Bay Area
    Code:
    <script language ="JavaScript">
    <!--
    function validate()
    {
    x=document.myForm;
    at=x.myEmail.value.indexOf(".edu");
    at2=x.myEmail.value.indexOf(".com");
    at3=x.myEmail.value.indexOf(".net");
    at4=x.myEmail.value.indexOf(".gov");
    at5=x.myEmail.value.indexOf(".org");
    if (at != -1 || at2 != -1 || at3 != -1 || at4 != -1 || at5 != -1)
    	{
    	alert("Not a valid domain");
    	return false;
    	}
    }
    -->
    </script>
    
    Code:
    <form name="myForm" action = "email.php" method = "POST" onsubmit="return validate()" >
    <font face="Verdana, Arial, Helvetica, sans-serif" size="2">Email:
    <input type = "text" size ="25" name = "email">
    <?php
    echo "<input type=\"hidden\" name=\"emailData\" value=\"$emailData\">";
    ?>
    <input type = "submit" name = "Send" value="Send"> 
    
    </form>
    
     
  2. AccidenT

    AccidenT Remember I will always love you, as I claw your fu

    Joined:
    Oct 2, 2000
    Messages:
    1,880
    Likes Received:
    0
    Location:
    Portland, ME
  3. RaginBajin

    RaginBajin Have you punched a donkey today?

    Joined:
    Dec 24, 2001
    Messages:
    8,740
    Likes Received:
    0
    Location:
    NoVA
    what was the answer. The thread is gone.
     

Share This Page