Limit checkboxes with jquery based on checked radio buttons

Posted by Hiskie on Stack Overflow See other posts from Stack Overflow or by Hiskie
Published on 2012-06-02T20:25:42Z Indexed on 2012/06/02 22:41 UTC
Read the original article Hit count: 229

Filed under:
|
|

So, i have this problem with some checkboxes. First of all let me tell you about the "project" itself. It's a webform, the user must complete it and check some checkboxes and radio buttons depending on what he would like to purchase. First of them are 2 radio bullets, numbered 1 and 2, and represent the quantity of the product he wants to purchase. Next to those are about 5 checkboxes that represent the color of the product, it doesn't matter how many of them are, the thing is ... i want, when a user selects 1 at the radio buttons, only 1 checkbox to be active, if he selects 2 then only 2 checkboxes to be available to check. So.. could someone help me? I thought of jQuery but i don't know...

There are two divs, the first div with the id of let's say #radioButtons has 2 radio buttons, and the second div has the rest of the checkboxes.

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about checkboxes