3 Replies Latest reply on May 9, 2011 7:56 PM by Ned Murphy

    Accepting time formatted text only

    Neat Gadget Level 1

      I want to have a text field that accepts only time formatted text. ie HH;MM:SS AM

       

      Do I do this with the restrict parameter? If so how?

       

      Andrew

        • 1. Re: Accepting time formatted text only
          Ned Murphy Adobe Community Professional & MVP

          The restrict property will only control which individual characters the textfield allows, it will not control format.  So you could use it to some extent if the textfield is being filled manually by a user, to only allow numbers, colons, and APM.  But it won't do anthing to help wrt the format.

           

          As far as restricting the text to a particular format, it partly depends on when you intend to be checking for this format.  If this is an input textfield, you have to have monitors set up to detect each character as it is entered to test whether it inhabits a valid position in the string.  If the textfield is filled dynamically in one shot, then all 11 characters have to be examined in a similar manner as with typed entries.

          • 2. Re: Accepting time formatted text only
            Neat Gadget Level 1

            Yes I meant to say it was a textinput field.

            • 3. Re: Accepting time formatted text only
              Ned Murphy Adobe Community Professional & MVP

              Then you can use the restrict property to limit which characters can be entered, but you'll need to test each entry as the user makes it to make sure it is in accordance with the position of the format it is trying to fill.

              1 person found this helpful