#9609 closed bug (duplicate)
Checkbox disabling using .prop(), Chrome
Reported by: | anonymous | Owned by: | |
---|---|---|---|
Priority: | low | Milestone: | 1.next |
Component: | attributes | Version: | 1.6.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
This has the expected effect in Firefox and Safari (haven't tested IE):
$(':checkbox').change(function() {
if($(':checkbox:checked').length == 2) {
$j(':checkbox').not(':checked').prop('disabled', 'disabled');
} else {
$j(':checkbox').removeProp('disabled');
}
});
In Chrome the checkboxes will disable if the else statement isn't there, when it is the code is effectively ignored.
Changing .prop() to .attr() solves the problem. Of course my understanding of .prop() vs .attr() could be incorrect.
Change History (3)
comment:1 Changed 12 years ago by
comment:2 Changed 12 years ago by
Component: | unfiled → attributes |
---|---|
Priority: | undecided → low |
Resolution: | → duplicate |
Status: | new → closed |
As the docs state, do not use removeProp to remove native properties. disabled should be set to boolean true or boolean false, not strings.
Max OS X 10.6.7, Chrome 12.0.742.100