Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code not working #1

Open
ruarkvallen opened this issue Apr 27, 2020 · 4 comments
Open

Code not working #1

ruarkvallen opened this issue Apr 27, 2020 · 4 comments

Comments

@ruarkvallen
Copy link

ruarkvallen commented Apr 27, 2020

Added the code as is via Code Snippets, but form still accepts gmail and goes to our thank you page and adds the entries to the database. Is there anything i missed?

@LauGau
Copy link

LauGau commented Oct 4, 2020

Yes you forget the PHP part in your function.php file like this :

add_filter('fluentform_validate_input_item_input_email',
    function($errorMessage, $field, $formData, $fields, $form) {
        $target_form_id = 1;
        if($form->id != $target_form_id ) { 
            return $errorMessage ; 
        }

        if( $formData['email'] !=  $formData["email_1"]  ){
            $errorMessage=  'The emails doesn't match.';
        }

        return [$errorMessage];
    },
10, 5);

@AkhilAniyan
Copy link

AkhilAniyan commented Nov 2, 2020

Still the code not working!

Even though the emails are correct, it's not submitting! See here: https://prnt.sc/vc6158

If the email is wrong, the error shows fine: https://prnt.sc/vc61xb

Code Added to function.php: https://prnt.sc/vc63wr

@AkhilAniyan
Copy link

@techjewel Can you please help?

@alex-authlab
Copy link

alex-authlab commented Nov 3, 2020

Try this :

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);

If it does not work can you share your form URL link?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants