Change the Value in Field to CAPITAL Letters [RESOLVED]

You can do this by hooking into the filter gform_save_field_value. Specifically, see example 4. Uppercase Value for a basic example of setting all text inputs to uppercase. In your case, you’ll probably want to look at usage for targeting specific fields and then calling upon a function for uppercasing those values. Something like this would target Field ID 4 and Field ID 7 on Form ID 18:

add_filter( 'gform_save_field_value_18_4', 'uppercase_field_value', 10, 6 );
add_filter( 'gform_save_field_value_18_7', 'uppercase_field_value', 10, 6 );

function uppercase_field_value( $value, $entry, $field, $form, $input_id ) {

    GFCommon::log_debug( __METHOD__ . ': running.' );
    return strtoupper( $value );

}
1 Like