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.

In our mobile applications (intended for Android and iOS platforms), we have fields that should be filled by users.

If the user fills the field not in required format what should I do

  1. show the validation message and empty the field, or
  2. show the validation message and leave the field as the user initially filled it, letting him edit his old records?
share|improve this question
1  
I'll just link this here... stackoverflow.com/a/402889/22184 –  Adriano Varoli Piazza Aug 27 at 22:38

4 Answers 4

up vote 85 down vote accepted

Typing on mobile is a very arduous and unpleasant process, so we should try keeping it to a minimum.

Sometimes your users will have made just a small error that can be fixed by replacing or adding a character or two (typically they typed something instead of @ in an email address etc.). Sometimes they will have made a big error and they need to retype the whole thing. So unless you have a way of knowing or making an educated guess as to which type of error will be more common with your users and your type of data - it seems like there's no way of knowing. However, small mistakes are much more common by nature.

Even if we say that we have no way to know this, deleting an entire field on mobile is still much easier for the user than entering an entire field - you just hold the Delete key. So if we keep the data, those who would've preferred that we clear the field have a small price to pay for our decision, since the field is deleted easily. But if we clear the data, those users who would've preferred that we keep it, have a high price to pay - they need to retype everything.

Seems to me that keeping the data is definitely the safer way to go.

share|improve this answer
20  
It's also good to show them what they had so they don't make the same mistakes twice. –  Majo0od Aug 26 at 13:29
19  
Also true for non-mobile. –  Aryeh Leib Taurog Aug 26 at 13:31
1  
With touch, you don't even need to hold the delete key on some devices/browsers - I can long-press the field and "clear all" –  Izkata Aug 26 at 14:09
8  
Exception: password fields (where you don't see what you typed anyway). And fields that the user should type in twice to ensure correctness (I'd suggest to maybe keep one and clear the other). And of course captchas ;) –  Hagen von Eitzen Aug 26 at 15:42
3  
@sapi. Clearing passwords is a security concern: The incorrect password is probably only slightly incorrect, or is a password for another account. The server should never publish passwords, so the new copy of the page should not contain the password. (This may not apply if the validation is done client side or with Ajax.) –  TRiG Aug 27 at 13:59

From a usability point of view, definately keep their entry there. There is nothing more annoying to users, in our experience, than clearing their entry on failing validation. They need to be able to see what they have done wrong, and if you clear it they are having to use their memory.

share|improve this answer
8  
Definitely true on non-mobile platforms as well. –  Aryeh Leib Taurog Aug 26 at 13:32

Why not provide a way for user to do both ? Data can be left intact as suggested by others and providing a small "X" button/icon ( similar to the magnifying glass icon usually seen in search boxes) at the end of text box to clear the whole thing if the user intends to.

share|improve this answer
    
Said small X button should preferably be very near the magnifying glass. Also, no need for a confirmation prompt. Also, disable form submit from keyboard. Users still have a 50% chance of doing the action they intended to. –  Jan Dvorak Aug 30 at 14:08

Generally speaking, especially for text type input or textarea field, it is better to keep the existing text upon validation error. However, depending on your actual scenario, there may be other decision making steps that you might need to consider:

  • If it is in a totally wrong format. Example you requested for numbers and the user fills up the field with alphabets, clear it and show error message. It is meaningless to keep input that you do not want to accept.
  • If it is in a partially wrong format. Example you want users to enter a description about themselves, but clearly stated that URLs are not accepted, remove any URLs programmatically and save the input without showing any error message.
  • If it contains sensitive information. Example user entered a wrong password. Clear it and show error message upon authentication failure.
  • If you detect abnormal inputs such as extra POST parameters, clear the form but do not show any error message. If possible, redirect user to another page or log out the user.
share|improve this answer
    
"remove any URLs programmatically" -- never modify user input behind their back. Especially not when that involves content deletion. Especially not if you think object.cx is a URL rather than a piece of code. –  Jan Dvorak Aug 30 at 14:10
    
"If you detect abnormal inputs such as extra POST parameters, clear the form but do not show any error message. If possible, redirect user to another page or log out the user." - Bad. Bad. Bad. How ever will I debug my app that's trying to interface with your app now? Unless, of course, you don't like my app trying to submit a form. –  Jan Dvorak Aug 30 at 14:12
    
@JanDvorak, for URL detection, I tend to use a more stringent regex to minimize false positives like the one you pointed out. In the real world, there is always a trade-off between security and usability. Of course, this site is all about UX and I digressed. –  Question Overflow Aug 31 at 3:31

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.