Support

Account

Home Forums Front-end Issues acf_form values not updating after Javascript validation Reply To: acf_form values not updating after Javascript validation

  • So the way I ended up implementing this was using the acf/validate_save_post action and removing all Javascript validation. By using acf/validate_save_post, you can return Javascript errors using acf_add_validation_error('acf[field_4a5c3fe1d1]', 'some error description');. Notice that you have to use acf[field_id] in this, you cannot use a post value UNLESS it is an additional field in the front end form. This took a day of debugging and I would love it if the documentation was updated for this use case. For those of you trying this and slamming your head against the wall, just make sure to use acf/validate__save_post, acf_add_validation_error, and use the field ID if it is part of the post’s custom fields. Good luck!