Check Box don't work
Check Box don't work
Hi guys I have a question for you, I have in my code:
A checkBox that disabled an input field;
A select that if set to empty:
reset and disabled the input field;
set the checkBox to checked;
Why if I uncheck the checkBox and I set the select as empty the checkBox seems unchecked ???
See more
http://jsfiddle.net/yRety/1/
This is my code:
<select class="select">
<option value=''>Select</option>
<option value="1">Option1</option>
</select>
<label>code:</label>
<input disabled class="code"></input>
<input disabled checked type="checkBox" class="check" title="Uncheck to Enable"></input>
$(document).on('click', '.select', function(){
if($(this).val() == ''){
$('.check').attr('disabled', true);
$('.check').attr('checked', true);
$('.code').attr('disabled', true);
$('.code').val('');
}
else{
$('.check').attr('disabled', false);}
});
$(document).on('change', '.check', function(){
if($(this).is(':checked'))
$('.code').attr('disabled', true);
else
$('.code').attr('disabled', false);
});
Topic Participants
cecco974
peter.aganyo