On our mobile app's login screen we have three fields, the last of which is used to build up a URL.
Since spaces isn't a good idea for the hostname part of a URL the user input must be sanitized before being used.
In my mind we have three options:
- Do nothing and allow any input. Try and do your best with what user gives app.
- Ignore spaces when pressed on keyboard.
- Show error as user types when spaces are found in edit box.
1 is the easiest to build, and user won't even know it is happening. User isn't aware she is typing in a part of a URL, she is typing in a "Company name". (I thought user learning might be a problem, and giving some feedback might be useful, but the typical use case is user enters these values once, and never again.)
2 feels quite strange when using it. You press a key, and nothing happens, nothing turns red, key press just goes away. Not a slick experience.
3 is probably worst of all the options. It makes the user fix a problem she will only understand after reading an error message box, and the spec for fixing the problem is in the error message. (I really hate it when apps do that.)
Any other options that I am missing, or something that could be done better?
More background: This app is by a group of mobile workers that all work for one company. Our company sells the software to their "company" and pick a URL for them (a human does this. Our volumes are still low enough that this is practical). The end users (the mobile workers) then receive username, password and their chosen by us company name. This information is all entered once on log in.
It is on our road map, to change this to the end users' email address. Then there will be no need for the user to select company name. The app will ask a server what URL to go to given the user's email address. This will make the very first thing our end users do with our app a much smoother process.
space
with a-
? So typingacme builders ltd
would come out asacme-builders-ltd
?microsoft.com
, notmicrosoft-corporation.com
(microsoftcorporation.com
actually redirects tomicrosoft.com
).