Displaying custom error messages in wp ninja forms

Viewed 6050

How can I show custom error messages in wordpress ninja forms plugin. I have searched for ninja forms docs but unable to reach the site. By default the error message is showing as

This is a Required field.

I want it to be

Please enter respective field name.


Ninja forms form builder have the following options for validation. See the below image Is there a way to display this error message with respective field name?.

Thanks in advance.

2 Answers

I have a rough jQuery solution that checks for any form changes/events and replaces the default error message for a specific input field.

$(document).on( 'nfFormReady', function( e, layoutView ) {

$('form').on('focus focusout keyup submit', 'input', function() {

    $('#nf-error-7 .nf-error-required-error').text('New Required Error Message');

});

});

I'm sure it can be adapted for multiple input types/fields.

Related