i am trying to check a value of a select box which filled according to user choice , this select will be populated once the user select options from other select boxes , now in the document.ready() the select is empty , i need to check if this select still empty , then disable a button , else , enable it again .
here is what i tried , it senses that the drop box is empty , but not when its populated !
if ($('#course-selection').html(null)) {
$('#show-wall-button').attr('disbaled','disabled');
}
else {
$('#show-wall-button').removeAttr('disabled');
}
this already fired on document.ready event when the page loads !.
I also tried this , but did not work
if ($('#course-selection').val(null)) {
$('#show-wall-button').attr('disbaled','disabled');
}
else {
$('#show-wall-button').removeAttr('disabled');
}
you can try this: