rendered paste body$(document).ready(function() { $('.forma span p input').change(function() { $('.forma span p input').attr('disabled', true); $.get('/getcheckboxes.php', { id: $(this).attr('id') }, function (request) { var data = request; /*if (data.current) { data.current(function(index, value) { $('#'+data.current+'[' + value + ']').attr('disabled', false); }*/ if (data.trademark) { data.trademark.each(function(index, value) { $('#brand[' + value + ']').attr('disabled', false); }); } if (data.size) { data.size.each(function(index, value) { $('#size[' + value + ']').attr('disabled', false); }); } if (data.season) { data.season.each(function(index, value) { $('#season[' + value + ']').attr('disabled', false); }); } if (data.mat_inside) { data.mat_inside.each(function(index, value) { $('#mat_inside[' + value + ']').attr('disabled', false); }); } if (data.mat_outside) { data.mat_outside.each(function(index, value) { $('#mat_outside[' + value + ']').attr('disabled', false); }); } if (data.design) { data.design.each(function(index, value) { $('#design[' + value + ']').attr('disabled', false); }); } if (data.kind) { data.kind.each(function(index, value) { $('#kind[' + value + ']').attr('disabled', false); }); } }, 'json'); });});