Skip to content

Code not working #1

Open
Open

Description

@ruarkvallen

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?

Activity

  1. LauGau commented on Oct 4, 2020

    @LauGau

    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);
  2. AkhilAniyan commented on Nov 2, 2020

    @AkhilAniyan

    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

  3. AkhilAniyan commented on Nov 2, 2020

    @AkhilAniyan

    @techjewel Can you please help?

  4. alex-authlab commented on Nov 3, 2020

    @alex-authlab

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions