Reply to comment

Re: Flex Examples : Validating user input in a TextInput ...

Hmm... Before a Developer commits to using this technique, I would strongly recommend considering its impact on usability.

In actual usability testing, I have seen overly-aggressive validation introduce new problems (at least for Users), despite its general attractiveness (at least for the Developer).

In this case, you may find that your users are confused when characters that they (thought?) they typed don't actually appear in the field. Or they may think that your application is 'broken'--perhaps not the impression that you want them to have.

You may want to consider not triggering the validation check until later in the work flow. By 'later' I mean a time such as the following: upon form submittal; when focus leaves the field; or AFTER the illegal character has been echoed and is visible to the user. As a broad rule, waiting until form submittal is usually later than is desirable (from a usability standpoint), but validating before character echo is usually earlier than is desirable. Typically, on echo or on field losing focus is best.

The one scenario in which I sometimes do use early triggers (such as the textInput event), is when I have a rigidly-formatted, masked input field (such as a US Social Security Number field with hyphen ('-') masks. In that case, I use it to allow users to enter the hyphen characters, but filter them out from the field's value.

===============
Sense or Non-sense?

Reply

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options