Replacing default form error messages

We're shifting our Forum based support to a more dedicated support system!

We'll be closing our Forum support from 10th June, 2020 and move to Email Support assistance.

  • If you are a WCFM premium add-ons user, contact us- here
  • Want to know more before buying our add-ons? Send Pre sale queries- here
  • If you are a WCFM free user, please open a support ticket at WordPress.org
  • For WCFM App related queries, reach us- here
From now the forum will be read-only!

Multi Vendor Marketplace Plugin | WCFM Marketplace Forums WCFM – Ultimate Replacing default form error messages

Viewing 4 reply threads
  • Author
    Posts
    • #60753
      hello4
      Participant

      Hello there,

      Could you please show me how to replace the default form error messages (the exhaustive list of required fields), with a custom error message? Something like “Please complete the required fields”.

      Thanks and regards,

    • #61264
      WCFM Forum
      Member

      Hi,

      Please use this snippet –

      function wcfm_custom_0905_translate_text( $translated ) {
      	$translated = str_ireplace( 'This field is required.', 'Please complete the required fields.', $translated );
      	return $translated;
      }
      add_filter('gettext', 'wcfm_custom_0905_translate_text');
      add_filter('ngettext', 'wcfm_custom_0905_translate_text');

      Thank You

    • #61294
      hello4
      Participant

      Hello,

      Thanks for the reply, but that’s not what I meant. Please see the attached screenshot. Instead of all those messages, I want to display one simple message, something like ‘Please complete the required fields’ or something. How can I do that?

      Thanks and regards,

      Attachments:
      You must be logged in to view attached files.
    • #61952
      WCFM Forum
      Member

      Hi,

      This is not possible using default validation system.

      To show one message have to write separate validation code.

      Thank You

    • #61956
      eArtisan
      Guest

      Hello again,

      Could you please explain how to write a new validation system (just the file names and other things to be changed) as the default validation messages look pretty basic and don’t look great at all?

      Thanks and regards,

Viewing 4 reply threads
  • The topic ‘Replacing default form error messages’ is closed to new replies.