Hello,
I am creating a form field on a contact form on my website.
I need to ensure that a few particular fields have the proper capitalization once submitted. I need the first letter of the field (first name, last name, etc) to be capitalized, but not any of the remaining letters.
I know this can be done in JavaScript, but want it to be done server side in PHP. I am not a web developer, and need to try to figure this out. I have found that I will need to use “ucfirst” to accomplish this, but that is about as much as I can understand.
Here is what I have in my form now:
<div><label for="last_name">Last Name:</label><input class="required" id="last_name" name="last_name" type="text" value="<?php {echo ucfirst("$last_name"); }?>" /></div>This obviously is not working. I don’t care if the capitalization shows up on screen, I just need it to be submitted to my database correctly. Can someone help me?
Thanks in advance!
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.