Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Jquery get multiple checked values from checkbox

//This are the list of checkbox(2 selected, 2 unselected)
<input name="numchec"  type="checkbox" value="1" checked/>
  <input name="numchec"  type="checkbox" value="2" />
  <input name="numchec"  type="checkbox" value="3" checked/>
  <input name="numchec"  type="checkbox" value="4" />
  
 //Jquery Code
 
 $(document).ready(function(){
     var data=$('input[name=numchec]:checked').map(function(err, el) {
      			return $(el).val();
  			}).get();
     alert(data)
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Jquery #multiple #checked #values #checkbox
ADD COMMENT
Topic
Name
7+6 =