The Community forums are being phased out in favor of a new Slack group.
Add your email address below to get an invitation to join the community slack group

Slack Signup
Newsletter Optin
Help Desk

Checkbox Limit

Labels

This Discussion is public

Notifications

Is there a tested way to limit how many checkboxes are checked?

I have to provided 5 options, and the user can choose up to 2.

You can do this with jQuery: https://stackoverflow.com/questions/19001844/how-to-limit-the-number-of-selected-checkboxes

Thanks! I did try this as I saw in another post but the code renders as text in the form page and not triggers as script. When I add *script* and */script* to hold that code, I get an error message saying I can do that. I am placing this code in the back end of the Form under Custom HTML. Is there a better way to add this?

jQuery code goes in the custom HTML in the after fields area. It must be wrapped in script tags.

If you are using Wordfence, it will block actions like this and you have to whitelist the action.

Discussion closed.