1 Reply Latest reply on Oct 4, 2006 6:13 PM by kglad

    Email Validation Contact Form

    Allbetzareoff2
      Im creating a contact form in flash 8 but im having trouble with the email validation. when i do the code for the "@" symbol it doesnt work.

      my code is...

      on(release){

      // If First Name is Empty
      if(first_tb.text==""){
      error_tb.text="**Invalid First Name!**";

      }else if(first_tb.length<2){
      error_tb.text="**Invalid First Name!**";

      }else if(last_tb.text==""){
      error_tb.text="**Invalid Last Name!**";

      }else if(last_tb.length<2){
      error_tb.text="**Invalid Last Name!**";

      }else if(email_tb.text==""){
      error_tb.text="**Invalid Email Address!**";

      }else if(email_tb.indexOf("@")<=1){
      error_tb.text="**Invalid Email Address!**";



      }else{
      //clears error message
      error_tb.text="";
      //Sumits Data to website
      var sendData:LoadVars = new LoadVars();
      sendData.firstName = first_tb.text;
      sendData.lastName = last_tb.text;
      sendData.emailValid = email_tb.text;
      sendData.messageNew = message_tb.text;
      sendData.send(" http://adambenjamin.com/test.php","_blank","POST");
      }

      }