The function disables select boxes that do not match with the main category. I have one main category and two subcategories. Is there a way i can hide and show the subcategories select boxes instead of disabling them?
JS/AJAX
<script type="text/javascript">
var formObject = {
run : function(obj) {
obj.nextAll('.update').html('<option value="">----</option>').attr('disabled', true);
var id = obj.attr('id');
var v = obj.val();
jQuery.getJSON('update.php', { id : id, value : v }, function(data) {
if (!data.error) {
obj.next('.update').html(data.list).removeAttr('disabled');
} else {
obj.nextAll('.update').html('<option value="">----</option>').attr('disabled', true);
}
});
}
};
</script>