Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery Validation at least one checkbox is selected
    primarykey
    data
    text
    <p>I have the following piece of html code for form checkboxes</p> <pre><code>&lt;div class="drinking col-xs-12"&gt; &lt;div class="col-xs-7 drinkingLeft"&gt; &lt;input type="checkbox" name="allwines" id="allwines" value="0" class="require-one col-xs-1 styled myClassA" value="0" data-label="All Wines" /&gt; &lt;input id='allwinesHidden' type='hidden' value='0' name='allwines'&gt; &lt;/div&gt; &lt;div class="col-xs-5 drinkingLeft"&gt; &lt;input type="checkbox" name="beer" id="beer" value="0" class="require-one col-xs-1 styled myClassB" value="0" data-label="Beer" /&gt; &lt;input id='beerHidden' type='hidden' value='0' name='beer'&gt; &lt;/div&gt; &lt;div class="clearix"&gt;&lt;/div&gt; &lt;div class="col-xs-7 drinkingLeft"&gt; &lt;input type="checkbox" name="redwines" id="redwines" value="0" class="require-one col-xs-1 styled myClassC" value="0" data-label="Red Wines" /&gt; &lt;input id='redwinesHidden' type='hidden' value='0' name='redwines'&gt; &lt;/div&gt; &lt;div class="col-xs-5 drinkingLeft"&gt; &lt;input type="checkbox" name="cider" id="cider" value="0" class="require-one col-xs-1 styled myClassD" value="0" data-label="Cider" /&gt; &lt;input id='ciderHidden' type='hidden' value='0' name='cider'&gt; &lt;/div&gt; &lt;div class="clearix"&gt;&lt;/div&gt; &lt;div class="col-xs-7 drinkingLeft"&gt; &lt;input type="checkbox" name="whitewines" id="whitewines" value="0" class="require-one col-xs-1 styled myClassE" value="0" data-label="White Wines" /&gt; &lt;input id='whitewinesHidden' type='hidden' value='0' name='whitewines'&gt; &lt;/div&gt; &lt;div class="col-xs-5 drinkingLeft"&gt; &lt;input type="checkbox" name="spirits" id="spirits" value="0" class="require-one col-xs-1 styled myClassF" value="0" data-label="Spirits" /&gt; &lt;input id='spiritsHidden' type='hidden' value='0' name='spirits'&gt; &lt;/div&gt; &lt;div class="clearix"&gt;&lt;/div&gt; &lt;div class="col-xs-7 drinkingLeft"&gt; &lt;input type="checkbox" name="sparkling" id="sparkling" value="0" class="require-one col-xs-1 styled myClassG" value="0" data-label="Sparkling/Champagne" /&gt; &lt;input id='sparklingHidden' type='hidden' value='0' name='sparkling'&gt; &lt;/div&gt; &lt;div class="col-xs-5 drinkingLeft"&gt; &lt;input type="checkbox" name="fortified" id="fortified" value="0" class="require-one col-xs-1 styled myClassH" value="0" data-label="Fortified" /&gt; &lt;input id='fortifiedHidden' type='hidden' value='0' name='fortified'&gt; &lt;/div&gt; &lt;div id="error_msg3"&gt;&lt;/div&gt; &lt;div class="clearix"&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>I want to make sure that at least one of the check boxes is selected.</p> <p>I want that <strong>NOT</strong> as an alert box ; however the message need to show up in the div error-msg3.</p> <p>Please note that all the inputs have different class names and ids. A staging link is at </p> <p><a href="https://bitly.com/1i3f1MY" rel="nofollow">https://bitly.com/1i3f1MY</a></p> <p>I am using jQuery validation to validate rest of the form. Will be nice to get solution through jquery validation.</p> <p>Thanks in advance</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload