1 Reply Latest reply on Jun 18, 2008 3:11 AM by atta707

    How to use string format in TextInput?

    Noppadon Sodram
      How to use string format in TextInput?
      Ex.
      HH:MM:SS when typing message appear in 12:34:56 form.
      N,NNN when typing message appear in 1,234,567 form.
        • 1. Re: How to use string format in TextInput?
          atta707 Level 2
          look up for "Using formatters" in the FB help.

          Essentially you'll instantiate a format, NumberFormatter for numbers for example, and set it's properties like e.g. showing a thousand separator and then one some event of the TextInput -- valueCommit for example -- you'll do something like:

          ti.text = nf.format(ti.text)

          this is would also give you opportunity to validate user input using the same formatter and valid event.

          ATTA