2 Replies Latest reply on Feb 6, 2007 8:55 AM by jsmwalker

    Checking Text Fields to make sure not empty

    jsmwalker
      Hi

      I have a text input area, and having problems getting flash to check that the fields are not empty, have got it working on previous flash versions Flash 6 and before, however does not work on Flash 7 or 8, the code i am using as basic test is

      on (release) {
      if (subject eq "" or message eq "") {
      stop();
      } else {
      gotoAndStop(2);
      }
      }

      As I've said it works on version 6 and below, so something must have changed on the way flash 8 looks at this, am sure is easy, have tried replacing eq with == tried replacing or with || but to no avail, so am assuming its something to do with "", just need to check something has been entered.

      Regards

      J

        • 1. Re: Checking Text Fields to make sure not empty
          Mohan-V
          hey it's working fine here, i had tryed with with player 7.0...

          see this

          *************
          on(release)
          {
          if(mt_txt.text =="" || mt1_txt.text =="" )
          {
          mt_txt.text="not text";
          //trace("not text");
          }
          else
          {
          mt1_txt.text="there is text";
          //trace("there is text");
          }
          }
          *********************

          r u looking for this only...or anything else

          Thanks and regards
          monu
          • 2. Re: Checking Text Fields to make sure not empty
            jsmwalker Level 1
            ok this confuses me, the way i have now got it to work is by using

            on (release) {
            if (subject == null || message == null) {
            stop();
            } else {
            gotoAndStop(2);
            }
            }

            Will test again later, the only downside that i can find, is all works ok, but you can enter data and then delete it, and the form still submits :-(

            J