Three Checkboxes, One must be selected to enable submit button, needs Jquery?

Posted by Jamie on Stack Overflow See other posts from Stack Overflow or by Jamie
Published on 2010-04-29T17:44:49Z Indexed on 2010/04/29 17:47 UTC
Read the original article Hit count: 407

Filed under:
|
|
|

I have between 1-three checkboxes and by default they are all disabled. In order for the submit button to be active ove checkbox minumum must be selected. Can someone help me with a jquery snippet to achieve this? My markup looks like this and the site used jquery 1.42. Please and thankyou!

<form action="/cart/add" method="post" id="pform">
  <h3 class="goudy">Make your selection:</h3>
  <ul id="variants">
    <li>
        <input type="checkbox" name="id[]" value="39601622" id="radio_39601622" style="vertical-align: middle;" class="required" />
        <label for="radio_39601622[]">$38.00 - Original Antique Photo</label>
    </li>

    <li>
        <input type="checkbox" name="id[]" value="39601632" id="radio_39601632" style="vertical-align: middle;" class="required" />
        <label for="radio_39601632[]">$8.99 - SCAN</label>
    </li>

    <li>
        <input type="checkbox" name="id" value="39777962" id="radio_39777962" style="vertical-align: middle;" class="required" />
        <label for="radio_39777962">$2.99 - Rigid Sleeve</label>  
    </li>
  </ul>

  <div class="buttons clearfix">
    <input type="image" src="../images/add-to-cart.png" name="add" value="Add to Cart" id="add" class="send-to-cart" />
  </div>    
</form>

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about form