Email Confirmation Field

fluentform_validate_input_item_input_email #

Using this filter you can create an email confirmation field. By default email input name attribute is ’email’ and if you add another email input its name is ’email_1′ . So in this example, we have used these two names for two email field, make sure these match. Here is the following code :

 add_filter('fluentform_validate_input_item_input_email', function($errorMessage, $field, $formData, $fields, $form) {

    $target_form_id = 8;
    if($form->id != $target_form_id ) {
     return $errorMessage ;
    if( $formData['email'] !=  $formData['email_1']  ){
        $errorMessage=  ['Error! Email does not match'];
    return $errorMessage;
}, 10, 5);

Just change your form ID and place this code in your function.php file. You can do this for other fields as well such as the password fields using their respective validation filters. For the password field, the filter will be ‘fluentform_validate_input_item_input_password’ and the name attributes password fields which are by default ‘password’ and ‘password_1’.

Check all the input filter hook in this page fluentform_validate_input_item_input_text.

Powered by BetterDocs

Leave a Reply

Your email address will not be published. Required fields are marked *