• Resolved ladydev

    (@ladydev)


    I have multiple HTML Forms that use the MC4WP custom integration. They currently send user signups and tags to MailChimp however the form validation is not working. It displays the browser validation rather than the error messages from the plugin. I’ve checked and ensured that I’m following the documentation, I even tried adding custom messages, but nothing works.

    Here’s sample markup from one of the forms:

    <p>
      <label for="FNAME">
        <input type="text" name="FNAME" placeholder="First name" required id="FNAME"/>
    </label>
    </p>
    <p>
      <label for="EMAIL">
        <input type="email" name="EMAIL" placeholder="Your email address" required id="EMAIL"/>
    </label>
        </p>
    <p class="cbx-wrapper">
       <label>
    	<input type="checkbox" name="mc4wp-subscribe" value="1" /><span>Get our monthly newsletter</span>
    </label>
    </p>
    <p>
      <input type="submit" id="eb_ebook-name" value="Get the eBook" />
    </p>
    • This topic was modified 2 years, 3 months ago by ladydev.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Hey @ladydev,

    Thanks for reaching out to us.

    Can you please let us know which exact error/validation inside our plugin is not working? We use HTML5 (browser) based validation as the first step.

    Thread Starter ladydev

    (@ladydev)

    Hey Harish,

    Thanks for the quick response. Perhaps I’m making a mountain out of a molehill but the messages found in the ‘Messages’ tab are the ones not displaying. The Success message displays but the messages I’ve entered in the ‘Invalid email address’, and ‘Required field missing’ fields do not display, instead, the browser’s default error messaging is displayed.

    Thanks

    If you want to use your own messages instead of the standard build in HTML5 browser validation you would need to add your own javascript library to do that.

    HTML Forms is designed to work with normal build in browser validation and we don’t want to add any unneeded bulk such as JS validation libraries but it’s build in a way that you can add such things yourself.

    The messages you’ve entered under Messages are only shown if the browser doesn’t have build in validation features and the form is submitted with invalid data.

    Hope that helps. If you have any questions, please let me know!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Form Validation Not Working’ is closed to new replies.