Title: html required attribute for checkbox
Last modified: January 25, 2018

---

# html required attribute for checkbox

 *  Resolved [studiokb](https://wordpress.org/support/users/studiokb/)
 * (@studiokb)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/html-required-attribute-for-checkbox/)
 * 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](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](https://wordpress.org/support/users/lapzor/)
 * (@lapzor)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/html-required-attribute-for-checkbox/#post-9904557)
 * Can you please update to the latest version of the plugin and try again?
 * [https://github.com/ibericode/mailchimp-for-wordpress/issues/516](https://github.com/ibericode/mailchimp-for-wordpress/issues/516)
 * Hope that helps. If you have any questions, please let us know!
 *  Thread Starter [studiokb](https://wordpress.org/support/users/studiokb/)
 * (@studiokb)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/html-required-attribute-for-checkbox/#post-9905347)
 * 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](https://wordpress.org/support/users/studiokb/)
 * (@studiokb)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/html-required-attribute-for-checkbox/#post-9925460)
 * Hi,
    Is there any update on this? This is still an issue. Thanks
 *  Plugin Contributor [Harish Chouhan](https://wordpress.org/support/users/hchouhan/)
 * (@hchouhan)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/html-required-attribute-for-checkbox/#post-10012186)
 * 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](https://wordpress.org/support/users/studiokb/)
 * (@studiokb)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/html-required-attribute-for-checkbox/#post-10014595)
 * 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](https://wordpress.org/support/users/lapzor/)
 * (@lapzor)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/html-required-attribute-for-checkbox/#post-10039117)
 * I’ve confirmed this issue still exists and reopened the bug report.
    [https://github.com/ibericode/mailchimp-for-wordpress/issues/516](https://github.com/ibericode/mailchimp-for-wordpress/issues/516)
 * ​Thanks for letting us know.
 *  Plugin Contributor [Lap](https://wordpress.org/support/users/lapzor/)
 * (@lapzor)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/html-required-attribute-for-checkbox/#post-10089292)
 * 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.

 * ![](https://ps.w.org/mailchimp-for-wp/assets/icon-256x256.png?rev=1224577)
 * [MC4WP: Mailchimp for WordPress](https://wordpress.org/plugins/mailchimp-for-wp/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/mailchimp-for-wp/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/mailchimp-for-wp/)
 * [Active Topics](https://wordpress.org/support/plugin/mailchimp-for-wp/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/mailchimp-for-wp/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/mailchimp-for-wp/reviews/)

 * 7 replies
 * 3 participants
 * Last reply from: [Lap](https://wordpress.org/support/users/lapzor/)
 * Last activity: [8 years, 5 months ago](https://wordpress.org/support/topic/html-required-attribute-for-checkbox/#post-10089292)
 * Status: resolved