I need a generic validation for first and last name field that will be used everywhere. Currently I'm using:
/^[A-Za-z]?[A-Za-z ]*$/
I need a generic validation for first and last name field that will be used everywhere. Currently I'm using:
/^[A-Za-z]?[A-Za-z ]*$/
Yes you should!
Your suggestion about having a validation rule would be a very bad idea. Did you know, the world's most common last name is 王?
Here is a classic article that you need to read: http://www.kalzumeus.com/2010/06/17/falsehoods-programmers-believe-about-names/
All of these assumptions are wrong:
(...)
People’s names are written in ASCII.
(...)
People’s names do not contain numbers.
(...)
I'm not sure regarding the code your using but I think if you'll have a small guidelines tooltip that will state that says not to use special characters in the first and last name that will be a nice UX , though i dont know what the application your using .. and not sure how you will apply it there ..(this forum has a tooltip like that for the password type here I found that very usfull)