Change default name validation message programmatically

Is there a way to filter the default “We need to know your name. What if we wanted to send you a birthday cake?” validation message for the name field? Having to manually change this on every form ensures it get overlooked quite often.

Ideally without setting up translations or recreating the entire name validation filter (gform_field_validation).

Why that’s the default message is a topic for another day.

That isn’t a default message included with Gravity Forms or any of the add-ons.

Have you checked the field settings? Custom validation messages can be defined on the appearance panel of the field settings in the form editor.

If the message isn’t defined in the field settings, then it is most likely coming from custom code in the theme or another plugin via a filter like gform_field_validation

This is a default message in the Basic Contact template.

includes/template-library/templates/templates.php:32:

					'errorMessage'          => 'We need to know your name. What if we wanted to send you a birthday cake?',

That message can be customized on the appearance tab of the field settings in the form editor.

Correct. But per the initial question: Having to manually change this on every form ensures it get overlooked quite often.

There’s a next-to-zero chance a client or end-user will remember to change this when spinning up new forms.

The templates aren’t filterable and are actually going to be removed from the plugin and moved to an external API. A filter will most likely be added at that time. I know some add-on developers would like to register their own templates.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.