Hi All,
Please use the following code:
How to check checkbox is checked or not using jquery?
function validateMultipleCheck(formId){
if(formId == undefined){
var totalInput = $('input:checkbox').length;
}else{
var totalInput = $('#'+formId+' input:checkbox').length;
}
var checkedValues = '';
if(totalInput > 0){
$(":input:checkbox:checked").each(function(){
checkedValues = checkedValues + ',' + this.value;
})
}
return checkedValues;
}
var values = validateMultipleCheck();
alert(values);
Cheers!
Please use the following code:
How to check checkbox is checked or not using jquery?
function validateMultipleCheck(formId){
if(formId == undefined){
var totalInput = $('input:checkbox').length;
}else{
var totalInput = $('#'+formId+' input:checkbox').length;
}
var checkedValues = '';
if(totalInput > 0){
$(":input:checkbox:checked").each(function(){
checkedValues = checkedValues + ',' + this.value;
})
}
return checkedValues;
}
var values = validateMultipleCheck();
alert(values);
Cheers!
No comments:
Post a Comment