Home Forums General Issues Customising form validation (Error) Message


Customising form validation (Error) Message

  • Hi,

    I’m using the acf_form() function to render a frontend form, however I need to customise the validation error message that says Validation failed. X fields require attention, and cannot find a way to do so without hacking the code.

    The error message is generated in the showErrors() function inside acf-input.js – are there any hooks to filter the message? Or any actions that will be triggered when ACF notice is updated?


  • It is possible to change general messages in custom javascript code e.g.:

    acfL10n['Validation failed'] = 'My validation message';
    acfL10n['1 field requires attention'] = 'One invalid field';
    acfL10n['%d fields require attention'] = 'More invalid fields';

    I haven’t found better way.

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Customising form validation (Error) Message’ is closed to new replies.