• Resolved studiokb

    (@studiokb)


    Hi,
    I have a very simple form to sign people up to my mailchimp list. There are only 2 fields, email and a checkbox so people give consent to sign up. But I need this checkbox to be required for GDPR compliance. I am trying to simply add the html required attribute to the checkbox but when I do that the form will not send and I get the message “Please fill in all required fields” even though the checkbox was ticked.
    If I do not set the required field the form sends fine. I have tried the attribute required=”required” and also just required as per html says (https://www.w3schools.com/tags/att_input_required.asp)

    My form in Mailchimp for WP > Forms is basically this:

    <p>
        <label>Tick to consent</label>
        <label>
            <input name="INTERESTS[xxxxxxxx][]" type="checkbox" value="xxxxxxxxxx" required="required">
    <span>I consent to XXXXXX collecting my email address</span>
        </label>
    </p>
    <p>
    	<label class="screen-reader-text">Email address: </label>
    	<input type="email" value="" name="EMAIL" class="required email text" id="mce-EMAIL" placeholder="Newsletter Sign up" required="@">
    	<input type="submit" value="Sign up" name="subscribe" id="mc-embedded-subscribe" class="button submit">
    </p>

    Thanks

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Contributor Lap

    (@lapzor)

    Can you please update to the latest version of the plugin and try again?

    https://github.com/ibericode/mailchimp-for-wordpress/issues/516

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

    Thread Starter studiokb

    (@studiokb)

    Hi,
    Thanks for reply. I do not see an update available. The version of the plugin I have is 4.1.14. Is this the latest version?
    Thanks

    Thread Starter studiokb

    (@studiokb)

    Hi,
    Is there any update on this? This is still an issue.
    Thanks

    Plugin Contributor Harish Chouhan

    (@hchouhan)

    Hello,

    I apologize for the delay in replying. We are still working on the issue. In the meantime, I would suggest using a code example as this:

    <p>
        <label>Tick to consent</label>
        <label>
          <input name="consent" type="checkbox" value="1" required>  
    <span>I consent to XXXXXX collecting my email address</span>
        </label>
    </p>
    <p>
    	<label class="screen-reader-text">Email address: </label>
    	<input type="email" value="" name="EMAIL" class="required email text" id="mce-EMAIL" placeholder="Newsletter Sign up" required="@">
    	<input name="INTERESTS[XXXXXX][]" type="hidden" value="XXXXXX">
    	<input type="submit" value="Sign up" name="subscribe" id="mc-embedded-subscribe" class="button submit">
    </p>

    This will work temporarily. It will only do browser-based validation to test if the first checkbox is ticked. And if a user ticks it, then they will be subscribed and added to an interest group.

    Thread Starter studiokb

    (@studiokb)

    Hi,
    Thanks. I had to do a custom javascript solution to get this to work. I had to get it live last week. The HTML required attribute would be a lot easier. I hope you get it fixed.

    Plugin Contributor Lap

    (@lapzor)

    I’ve confirmed this issue still exists and reopened the bug report.
    https://github.com/ibericode/mailchimp-for-wordpress/issues/516

    ​Thanks for letting us know.

    Plugin Contributor Lap

    (@lapzor)

    If you are still having this issue, please make sure you are on the latest version of the plugin and re-save the form. That should solve the issue.

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

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘html required attribute for checkbox’ is closed to new replies.