Return to Snippet

Revision: 57749
at June 9, 2012 05:05 by serialk89


Updated Code
function checkTodos(){
 
	if($("#checkeverythink_btn").is(":checked")){
		$(":checkbox").each( function() {
			$(this).attr('checked', true);
		});
	}else{
		$(":checkbox").each( function() {
			$(this).attr('checked', false);
		});
	}
	
}

Revision: 57748
at June 8, 2012 06:06 by serialk89


Initial Code
function checkTodos(){
 
	var count = $("#count_prof").val();
	var array = new Array();
	var k = 0;
		
	for(var i = 1; i <= count; i++){
		
		$("#rut_prof_cbx_"+i).attr("checked", true);
			
	}
	
	$("#checkeverythink_btn").unbind('click', checkTodos).bind('click',descheckTodos);
	

}

function descheckTodos(){
 
	var count = $("#count_prof").val();
	var array = new Array();
	var k = 0;
		
	for(var i = 1; i <= count; i++){
		
		$("#rut_prof_cbx_"+i).attr("checked", false);
			
	}
	
	$("#checkeverythink_btn").unbind('click', descheckTodos).bind('click',checkTodos);

}

Initial URL


Initial Description
Chequea todos los checkbox con un mismo nombre desde uno aparte que tiene como ID "checkeverythink_btn"

Initial Title
Chequear todos los checkbox con jquery

Initial Tags
jquery

Initial Language
jQuery