How to Capitalize Name on Form Submissions

There are times that users do not pay attention to capitalizing the letters when typing form fields.

Problem

So, to fix this issue…

Solution

I found a way to correct this at the source (in Gravity Forms) using a bit of PHP. (Thanks for Scott bringing up this problem 🤟)

Simply add the following lines to your existing function in Script Organizer:

				
					// update "9" to your form ID and "20" to the Field ID
add_filter( 'gform_get_input_value_9_20', function( $value ) { return ucwords(strtolower( $value )); } );
				
			

Result

If the submitter fills the name / last name in this form “JOHN SMITH”, “john Smith” or similar the data would be recorded like “John Smith” in gravity form.