Hi,
On my forms, I have required fields. When there are empty, the following message is displayed :
There was a problem with your submission.
Errors have been highlighted below
How can I change this message ?
Thank you
Hi,
On my forms, I have required fields. When there are empty, the following message is displayed :
There was a problem with your submission.
Errors have been highlighted below
How can I change this message ?
Thank you
You can change the message for individual form fields by editing the field, going to the Advanced tab and customizing the validation message.
However the message you referenced above is the form wide validation message. Currently this can only be customized by a filter using PHP. Here is an example of the filter you would use to do this:
<?php
add_filter("gform_validation_message", "change_message", 10, 2);
function change_message($message, $form){
return "Failed Validation - " . $form["title"];
}
?>
Was looking for the same,
@Carl Hankcock
Thanks, but .. this code goes where?
you add the code snippet to your theme's functions.php file.
Thanks Kevin.
I found you can also just change the message in form_display.php.
Would there be any advantage of adding the filter to functions.php, over directly editing the message in form_display.php?
You never want to edit the core plugin files if you ever plan on updating to the latest version of Gravity Forms because any changes you make will be overwritten by the update.
The API hooks are there to allow you to change the functionality of Gravity Forms WITHOUT having to edit the plugin files themselves. This makes updates seamless so you can upgrade without overwriting your changes.
We always recommend users make changes using the API hooks and placing the code in the functions.php file for their theme.
Seems like this is a reasonable request - to change the general form validation message - why not consider making this an option in a future upgrade? I see where I can set the Form's Description and Confirmation Message, so why not allow me to set my own Validation (error) Message too?