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.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.