In this guide we will create a PHP function that will alter the values of two of the form fields before the form is processed. We will modify the values of two Text fields to set the value to uppercase.
Add the following code to the WordPress theme functions.php file (or create a plugin for it).
1234 5 678 9 10 11 | add_filter('quform_pre_process_1', function (array $result) { if (isset($_POST['quform_1_3'])) { $_POST['quform_1_3'] = strtoupper($_POST['quform_1_3']); } if (isset($_POST['quform_1_4'])) { $_POST['quform_1_4'] = strtoupper($_POST['quform_1_4']); } return $result; }); |
add_filter('quform_pre_process_1', function (array $result) { if (isset($_POST['quform_1_3'])) { $_POST['quform_1_3'] = strtoupper($_POST['quform_1_3']); } if (isset($_POST['quform_1_4'])) { $_POST['quform_1_4'] = strtoupper($_POST['quform_1_4']); } return $result; });