Wednesday, 17 September 2014

How to get checked values in checkbox in dynamically by using jquery and javascript?

var chkArray = [];
$(".chk:checked").each(function() {
 chkArray.push($(this).val());
});
var selected;
selected = chkArray.join(',') + ",";
if(selected.length > 1){
 alert("You have selected " + selected); 
}else{
 alert("Please at least one of the checkbox"); 
}

No comments:

Post a Comment