Take the 2-minute tour ×
User Experience Stack Exchange is a question and answer site for user experience researchers and experts. It's 100% free, no registration required.

I have one textbox that means to allow no special characters. Now, I have to choose below approaches:

  1. Display inline validating message say something like "char * is not allowed" (A) or "Your input cannot contain %$*&" (B) when user input chars in black-list.
  2. Block user from enter invalid chars. Meaning that if user hit chars that are in black-list, nothing would happend.

Which of the approaches should I take?

share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

With approach 2 (block invalid characters), the user might type something quickly and end up with a result which looks nothing like what they wanted.

Let's say a user-name field should only contain standard unaccented characters. A user could enter Juergen without a problem; but attempting to use ü instead of ue would be ignored and the user would end up with Jrgen.

Attempting to create a username like $4nta Cl4u$ would be similarly stymied: ntaClu.

This is bad: the user would have to work out what had been omitted and why and then correct it. Approach 2 should be avoided.

Method 1 (validation message) is therefore to be preferred — and this should be inline during entry rather than returned after the form is submitted.

I would prefer adding the user's invalid characters to the message as they are entered. Thus the message You cannot use ü would appear as soon as that character was typed; and in the second example it would end up as You cannot use $4[space]. (Actually using [space], not a blank character.)

In Method 1, it would be useful to make some help available as well in order that the user can find out exactly what is valid. That could appear as a tooltip, or open a separate page.

mockup

download bmml source – Wireframes created with Balsamiq Mockups

share|improve this answer
    
You need to be careful when you say which characters are allowed. "Special chars", "Invalid chars" and "Upper- and Lower-case letters without accents" are all very culture / system specific terms. If you are storing as US-ASCII then you cannot accept "ß" or "ı" which are lower case letters without diacritics (and not special or invalid to anyone who uses them regularly). Better still would be to change your backend to UTF-8 :) –  Colin Pickard Oct 17 '13 at 14:08
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.