Archive for the 'Jquery' Category
Simple JQuery check-all
17Jun09
Simple check all with Jquery:
function checkAll(el, fieldName){
var checkBoxes = $(‘input[name=' + fieldName + ']‘);
var curValue = el.value;
if(curValue == ‘Check All’){
$.each(checkBoxes, function() {this.checked = true});
el.value = ‘Uncheck All’;
} else {
$.each(checkBoxes, function() {this.checked = false});
el.value = ‘Check All’;
}
}
How to use?
Pass in the “this” keyword as the first parameter. Second, pass in the name of the fields that [...]
Filed under: Beginner, Javascript, Jquery | Leave a Comment
Search
-
You are currently browsing the ✩CodeStar✩ weblog archives for the Jquery category.