1 Reply Latest reply on Dec 1, 2006 10:03 AM by jfillman

    TextArea Validation

    jfillman Level 1
      There don't seem to be any clean ways to validate TextAreas, so I decided to try and check that some text is being entered, so below is my attempt, but it returns nothing. The Alert doesn't even show. Help!!

      private function validateForm) :Boolean {
      var frmValid:Boolean = true;

      if (txtDescription.selectionEndIndex < 5) {
      frmValid = false;
      }
      return frmValid;
      Alert.show(frmValid);
      }
        • 1. Re: TextArea Validation
          jfillman Level 1
          I actually need to validate around 30 text areas for text entry. Best I can come up with is setting a variable for each field and checking each ones length (txtDescription.text.length <5) and if it is more than 5 characters setting the variable to true. Then doing another check to see if any of the variables are false.

          This seems a bit too much, so if anyone has got a cleaner, faster approach, I'd really like some ideas.