0 Replies Latest reply on Jun 8, 2007 1:21 PM by Ipigi

    checking for empty fields?

    Ipigi
      Hi,

      I'm new to actionscript and I'm having a little trouble comparing the string from an input text box to check if its empty. I've made a form that I need to check to make sure that the user has entered something inside of two of the fields. The code I have in the background right now is as follows :

      on (release) {
      var nosend:Number = 0;
      if (form.name=="")
      {
      form.namereq = "enter your name";
      nosend = 1;
      }
      if (form.email=="")
      {
      form.emailreq = "enter your email";
      nosend = 1;
      }

      if(nosend != 1)
      {
      form.loadVariables("email.php", "POST");
      }
      }

      I've also tried using form.name==null but that has not worked. The variable and instance names are correct, if I comment out the If statements the fields get set correctly. I'm running CS3 and coding with AS2 as I am more familiar with it from my days of playing around with flash 4 when I was much younger.

      Thanks!
      Ip