This topic is locked
[SOLVED]

 uppercase first letter of First and Last names

4/24/2017 6:01:05 AM
PHPRunner General questions
M
mhollibush author

looking for a way to save the "fullname" as uppercase First letter of the First and Last name.

both on the "before record added" and and "before record updated"

romaldus 4/24/2017
$values["name"]=ucwords($values["name"]);
M
mhollibush author 4/24/2017


$values["name"]=ucwords($values["name"]);



Thank You - That Worked....
Here is another question, How can you STOP the user from entering all CAPITOL LETTERS in the fullname field?

romaldus 4/24/2017



Thank You - That Worked....
Here is another question, How can you STOP the user from entering all CAPITOL LETTERS in the fullname field?



$values["name"]=ucwords(strtolower($values["name"]));


M
mhollibush author 4/24/2017





$values["name"]=ucwords(strtolower($values["name"]));



THANK YOU!!!

need2sleepDevClub member 4/28/2017





$values["name"]=ucwords(strtolower($values["name"]));



Before you implement this code, think first if it might affect you negatively. I've been using it for a while now and starting to notice some complications.
While on the topic of this, I started realizing that it doesn't work for all names. What's the best way to make an exception for names that have "McDonalds" where the 'D' should also be capital? Do you do a search and replace or just ignore names that have "Mc" also customer's names with hyphens etc