I'm part of a team developing small web app. I'm responsible for frontend part of it. We've got form with inputs for user name and last name. Backend guy made a regex that requires name to be at least 3 letters long and it must start with a capital letter. I guess reason for it was for purpose only, but let's say it's necessary.

What type of frontend validation should I use? I'm thinking:

  1. Require by regex that user types his name with capital letter - but I know some people just don't care and type everything in lowercaps, so my thinking is it might scare some of them off

  2. Dynamically autocorrect first letter to capital with js

  3. Correct first letter to capital in backend

I think option 2 is best, but what do you think?


2 Answers 2


Get rid of the ridiculous character count limitation and accept whatever form of casing the user provides. If you wish to correct the casing at some point on the front end you can use JavaScript or text-transform in CSS. Users are generally dumb, lazy and rebellious. Don't ever trust them to enter information correctly.

  • Agree, the character count is ridiculous, especially given the number of Chinese two letter first names. en.wikipedia.org/wiki/Chinese_given_name
    – Tony UK
    Aug 1, 2018 at 16:08
  • 1
    agreed with the recommendation but it seems worth saying that treating users as "dumb and lazy" is bad news. Users have other things to do and think about, and interacting with whatever you've built in the way you want them to is very likely not their top priority in life. The end result may be similar, but the attitude makes a difference.
    – tobybot
    Aug 1, 2018 at 19:38

What is your reason for showing a lowercase to uppercase?

As a user, he/she just wants to put in their name. They shouldn't need to care about your technical limitations. Therefore, let the user type in her name in any way they want.

If you want to use one of your choices, I would choose nr 2. I don't think it's intrusive to show a lowercase becoming an uppercase while typing. Hard to say but it depends on how you solve it. Maybe worth user testing? If your users are used to smartphone keyboards, it probably won't be intrusive.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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