Title: Checkbox list limit
Last modified: August 21, 2016

---

# Checkbox list limit

 *  [lapd](https://wordpress.org/support/users/lapd/)
 * (@lapd)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/checkbox-list-limit/)
 * Hi!
 * I was wondering if the following is possible…
 * I have made a checkbox list of choices for users to select some products, but
   I want them to select 2 options at most. Is it possible to not let them submit
   the form (some kind of error message) if they select 3 or more?
 * Thanks!
 * [http://wordpress.org/plugins/wordpress-form-manager/](http://wordpress.org/plugins/wordpress-form-manager/)

Viewing 1 replies (of 1 total)

 *  [ephrem](https://wordpress.org/support/users/ephrem/)
 * (@ephrem)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/checkbox-list-limit/#post-4077776)
 * Hi LapD,
 * Simply use the below code inside your header section:
 *     ```
       <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" ></script>
       	<script>
       jQuery(function(){
           var max = 2;
           var checkboxes = $('input[type="checkbox"]');
   
           checkboxes.change(function(){
               var current = checkboxes.filter(':checked').length;
               checkboxes.filter(':not(:checked)').prop('disabled', current >= max);
           });
       });
       	</script>
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘Checkbox list limit’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wordpress-form-manager.svg)
 * [Form Manager](https://wordpress.org/plugins/wordpress-form-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordpress-form-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordpress-form-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/wordpress-form-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordpress-form-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordpress-form-manager/reviews/)

## Tags

 * [limit](https://wordpress.org/support/topic-tag/limit/)
 * [list](https://wordpress.org/support/topic-tag/list/)

 * 1 reply
 * 2 participants
 * Last reply from: [ephrem](https://wordpress.org/support/users/ephrem/)
 * Last activity: [12 years, 8 months ago](https://wordpress.org/support/topic/checkbox-list-limit/#post-4077776)
 * Status: not resolved