• Resolved klaus2410

    (@klaus2410)


    Entering a name in a text field like ?Susanne Muster“, should be displayed in the email like ?SUSANNE MUSTER“.

    Please could anybody help to solve the Problem?

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • you need to access to user form data and capitalize the wanted fields

    https://contactform7.com/2020/07/28/accessing-user-input-data/

    hope it help!

    Thread Starter klaus2410

    (@klaus2410)

    Thank you for the hint, but I am not so experienced in developing. Therefore It would be nice if somebody can give me some code snippets.

    Thread Starter klaus2410

    (@klaus2410)

    I have tried this one, but it does not work.

    add_Action( ‘wpcf7_before_send_mail’,
    function( $contact_form, $abort, $submission ) {

    // Getting user input through the your-message field
    $your_message = $submission->get_posted_data( ‘your-message’ );
    $your_message = strtoupper($your_message);

    },
    10, 3
    );`

    sorry the right hook was wpcf7_posted_data…

    like this:

    add_filter( 'wpcf7_posted_data',
    	function ( $posted_data ) {
    		$vorname = $posted_data['Vorname'];
    		if( !empty( $vorname ) ){
    			$posted_data['Vorname'] = strtoupper($vorname );
    		}
    
    		return $posted_data;
    	}
    , 10, 1 );
    Thread Starter klaus2410

    (@klaus2410)

    It has worked! Thank you.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Entering upper-case letter in text field of CF7’ is closed to new replies.