views:

155

answers:

6

I have received requirements that ask to normalize text box content when the user changes the focus to another control on the same data input form. Example normalizations:

  • whitespace at the start and end of the input is trimmed
  • If the text box was made empty and this is not valid, replace the content of the text box with the default value

I have a feeling that this is not in line with good GUI design. I have read the Windows UX Guidelines for text boxes but I did not immediately find any relevant rules.

Is normalizing text box content in this way acceptable?

+1  A: 

It's a fairly standard feature, especially the whitespace trimming. The default value replacement raises a larger flag just because it is less common.

Hank Gay
+5  A: 

I have definitely seen this before (examples elude me right now) but I personally don't like it when the UI changes my input. If the UI is smart enough to change my input on me then it should accept it as is and change the value when it needs to process it.

When the input changes auto-magically you are now forcing the user to stop and ask themselves why it changed and if they did something wrong or if the application has an error. Don't make the user think!

cagreen
This assumes the UI is smart enough to know exactly what the user is thinking - generally not a good idea to rely on at all! Automatic normalization is a conversation: the UI is telling the user what it thinks the user meant. This is good - it's far better to make the user think, than to cause the user to be annoyed by mistakes from simple communication problems.
Ilari Kajaste
In vertical apps, it's pretty common (and indeed expected) to take short form entry from users, then convert it into an expanded, trimmed, etc. version. Best to do it when fields/areas are exited in order that the user can verify that the conversion is correct.
Brian Knoblauch
+2  A: 

If the user wants it, and the Stakeholder ask for it, then is perfectly safe. Trimming is very common. and the replace is common when you are talking about filling textbox with numbers. (a 0 instead of a blank).

gbianchi
+1  A: 

I'm pretty sure that I've seen versions of Microsoft Office that do this - putting "pt." after a value in points, for instance. Microsoft's endorsement should be a good sign.

Mark Ransom
Microsoft does a lot of stuff. Some of it goes wrong. I don't think it's a valid sign that *some version* of Office does this.Still, resolving ambiguities (like adding the pt.) is good practice.
Ilari Kajaste
+1  A: 

We have quite a few of these kind of requirement. The reason given for forcing a default value rather than a blank space is that it looks better in reports or if the client wants to see the live system. A blank looks a bit like "couldn't be bothered to enter anything". For a similar reason, we often upper-case the text for consistency as the users never use consistent formatting.

CodeByMoonlight
+3  A: 

Generally, you should accept user input exactly has they entered it. Chances are users did it that way for a good reason. For example, imagine a user entering a foreign address, and then your app screws it up trying to format like a domestic address. At the very least, users entered the input the way they’re used to it being, so changing it can make it hard for them to cross-check it.

However, there are several exceptions:

  • Add defaults to incomplete input. Adding input the user left off (e.g., years to dates, units to dimensions) provides good feedback on how the app is interpreting the input that would otherwise be ambiguous. This also encourages the user to use defaults, making their input more efficient.

  • Resolve other ambiguities. Change to an unambiguous format if the user’s format is open to interpretation. For example, if you have international users, you may want to change “9-8-09” to “Sep 8 2009” (or “9 Aug 2009”) to provide feedback on what your app considers the month and day to be.

  • Add delimiters when none provided. Automagically adding standard or even arbitrary delimiters to long alphanumeric strings (e.g., phone numbers, credit card numbers, serial numbers) provides an input display that the users can crosscheck more easily. Sometimes users may enter a string without delimiters in order to go faster or because they are the victim of web abuse by sites that refuse to accept even standard delimiters.

  • Spelling, grammar, and capitalization correction. Users often appreciate this, but only if there’s also a means to override it. Some users like to use "i" as the first person pronoun.

If the field is used by more than one user, then you probably should automatically format the value in some standard way that accommodates the majority of your users, but that should be done when the value is stored on the backend, not when focus leaves the field. For example, if a user enters a time of 15:30 it should remain as 15:30 as long as the user views the page. However, the next time a user (any user) retrieves the data, it should appear as 3:30pm (if that’s how most of your users are used to seeing time).

Such backend formatting applies to trimming whitespace so that all users can search, find, and sort on the field consistently. It’s probably not a good idea to replace a blank value (or any invalid value) with the default because users are unlikely to anticipate getting that value. An exception would perhaps be changing blank to 0 for numeric fields in situations where obviously blank == none == zero, but again this probably should be done when storing in the backend, not in the field itself. If blank is ambiguous, (e.g., may mean 0 or may mean "I don't know") then the second bullet above applies, and you may want to autocorrect in the field when focus is lost.

Of course, if your users vary in how they need to have a data type formatted, then you can have different variants of the app that display the data type in different ways for different user groups, or you can make the format of the data type a user preference, but that’s really another issue.

Michael Zuschlag