Support

Account

Home Forums General Issues Error page when form submitted ajax validation failed Reply To: Error page when form submitted ajax validation failed

  • This is because you have errors in your php code

    For example

    
    $login = (!empty($_POST['acf'][EMAIL_FIELD])) 
    

    Where is EMAIL_FIELD defined? This is probably generating an undefined constant warning that is causing the AJAX request to fail, unless you have these defined in some other code.

    also, you should be specifying either the field group or the fields, not both.

    When specifying the fields this needs to be an array of field keys, where are these constants defined? Are they field key values?

    
    'fields' => [
                    LASTNAME_FIELD,
                    FIRSTNAME_FIELD,
                    EMAIL_FIELD,
                    EMAIL_FIELD . 'repeat',
                    PHONE_FIELD,
                    PASSWORD_FIELD,
                    PASSWORD_FIELD . 'repeat',
                    GENDER_FIELD,
                ],
    

    If I am wrong and these constants are defined somewhere then you need to turn on error logging and find what is causing the error that is breaking the AJAX request.