showing results for - "multiple checkbox validation in jquery"
Sidney
19 Jan 2019
1<!-- Find values of checked boxes with jquery -->
2<div class="fruit">
3  <label>
4    <span>Apple</span>
5    <input onchange="checkValues()" name="apple" type="checkbox" value="apple">
6  </label>
7
8  <label>
9    <span>Banana</span>
10    <input onchange="checkValues()" name="banana" type="checkbox" value="banana">
11  </label>
12
13  <label>
14    <span>Grape</span>
15    <input onchange="checkValues()" name="grape" type="checkbox" value="grape">
16  </label>
17</div>
18
19<script>
20  function checkValues() {
21    $('.fruit input:checkbox').each(function(index, element) {
22      if (element.checked === true) {
23        console.log(element.value)
24      }
25    });
26  }
27</script>
Leni
23 Jan 2017
1function onSubmit() 
2{ 
3    var fields = $("input[name='list']").serializeArray(); 
4    if (fields.length === 0) 
5    { 
6        alert('nothing selected'); 
7        // cancel submit
8        return false;
9    } 
10    else 
11    { 
12        alert(fields.length + " items selected"); 
13    }
14}
15
16// register event on form, not submit button
17$('#subscribeForm').submit(onSubmit)
18
19//**************************************************
20// HTML
21<form method="POST" id="subscribeForm">
22    <fieldset id="cbgroup">
23        <div><input name="list" id="list0" type="checkbox"  value="newsletter0" >zero</div>
24        <div><input name="list" id="list1" type="checkbox"  value="newsletter1" >one</div>
25        <div><input name="list" id="list2" type="checkbox"  value="newsletter2" >two</div>
26    </fieldset>
27    <input name="submit" type="submit"  value="submit">
28</form>
29
queries leading to this page
js input checkbox onchangehow to check multiple checkbox on single click jquery2 checkbox can be selected jquerycheckbox javascriptmultiple checkboxes find checked statuscheck multiple checkboxes using jquerycheckbox onchange htmlget response and check multiple checkbox jquerymake multiple checkbox checked in jquerymulti checkbox checked jqueryhtml checkbox onchangejquery checked false for multiplemultiple checkbox selection in html jqueryonchange event checkbox javascriptselect multiple checkbox value using jqueryget value of multiple checked checkboxes jquerycheck multiple checkbox using jquerycheck checkbox onload javascriptselect multiple checkbox in jqueryget multiple checkbox checked value in jquerymulti checkbox checked function jqueryget value multiple checkbox jqueryinput type checkbox multiple value jqueryonchange checkbox eventselect multiple checkbox value in jqueryjavascript html checkbox onchangecheckbox 27 27 onchange javascriptcheckbox javascript onchangejavascript checkbox onchangeonchange checkbox javascripthow to get the multiple checkbox value in jqueryhow to select multiple checkbox in jqueryevent on checkboxjquery multiple checkbox 3acheckedget one checkbox value at a time jquery from multiple checkboxinput checkbox onchange javascriptjquery get multiple checkbox valuesselect multiple checkbox jquerycheckbox onchange eventget multiple checkbox using class in jqueryget multiple checkbox value in jqueryjavascript onchange checkboxcheckbox checked multiplemultiple checkbox checked in jquerymultiple select checkbox in jquery javascript checkbox onchange tagnamehow can i tell if at least 1 of multiple checkboxes is selected in jquerymultiple selected checkbox value in jqueryjquery multiple checkbox value checkbox click val getmultiple checkbox selection in select in html jqueryoncheck checkbox javascriptjavascript on checkbox clickjquery validation one check for multiple checkboxhow to select one checkbox from multiple checkboxes in jquerymultiple checkbox filtering with jqueryjquery to check if any checkbox is checked from multiple checkboxjs checkbox onchangemultiple checkbox get value jquerymultiple checkbox filter jquery demomultiple checkbox onchange jqueryhow to get the value of one checkbox from multiple checkboxes in jquerycheckbox onchangemultipel checkbox selected value in jqujerymultiple checkbox selection in select in html jquery plhow to check multiple check boxes selected in jquerymultiple checkbox value get in jqueryonchange checkboxvalidate multiple select checkbox in jqueryjavascript checkbox onclickhow to get multiple checked checkbox with dropdown 27 value in jqueryjs checkbox in select how to iterate multiple checkboxes and check in jquery multiple checkbox checked value in jqueryinput checkbox onchangejquery checkbox checked value array multiplecheckbox onchange javascripthow to get multiple checkbox value in jqueryselect one or multiple checkbox jquerymultiple checkbox value get in jquery ajaxget one check box value at a time jquery from multiple checkboxon checkbox check javascript functionhtml checkbox javascript onchangejquery multiple checkbox checkedjquery validation multiple checkbox requiredget multiple value from checkbox jquerymultiple select checkbox get value jqueryonchange input checkboxmultiple checkbox selection jqueryget multiple checked checkbox value jqueryjquery multiple checkbox checked valuejquery validation for multiple checkboxon selct box check checkboxhow to get multiple checkbox 27 27 value in jquerycheckbox checked onchange javascriptjquery select multiple checkboxesjavascript checkbox on changeget value from multiple checkbox jquerytake multiple checkbox button value jquerymulti checkbox jquery jquery multiple checkbox button changedcheck if a checkbox from multiple checkbox is checked jqueryjquery multiple checkbox change eventcheckbox javascripjquery multiple checkbox checked unchecked eventjquery checkbox multiple changehtml javascript checkbox onget multiple checkbox value jqueryget multiple checkbox visable value in jqueryselect checkbox in javascripthtml checkbox multiple jquerymultiple select checkbox jquerycheck if one checkbox is checked in multiple checkbox jquerymultiple checkbox click event in jquerycheck multiple checkbox checked or not in jqueryjs select checkboxhow to get multiple checkbox checked value in jqueryjquery get multiple checkbox valuejquery check multiple checkboxesonchange checkbox htmlget multiple checkbox value in jquery by namejquery multiple checkboxhow to get multiple checkbox value in jquery ajaxget multiple checkbox 27 27 value jqueryhow to check multiple checkbox is checked or not using jqueryonchange event in checkboxjs dom select checkboxcheck multiple checkbox in jquery2 checkbox checked then show div jquerycheckbox 27 27 onchange event javascriptjquery validation on multiple required checkboxcheckbox html onchangemultiple elements checked false jqueryjavascript checkbox onchange 5dselect checkbox javascriptget value of multiple checkbox jqueryget multiple checked 26 unchecked checkbox jqueryhow to add on change to multiple checkboxes jqueryjquery checkbox multiple checkedcheck if multiple checkbox is checked jquerymultiple checkbox validation in jqueryuncheck multiple checkbox jquery using namejquery get multiple checkbox 27 27 value if checkedget all multiple selected checkbox value in jqueryhow to get multiple checked checkbox 27 27 value in jqueryhow to get one value from multiple checkbox in jquerymultiple checkbox array select jqueryhow to get two checkbox checked jquerymultiple checkbox jquery validationcheckbox onchange jsjquery multiple checkbox checked eventmultiple checkbox validation in jquery