Bug Tracker

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#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 8 years ago by anonymous

Max OS X 10.6.7, Chrome 12.0.742.100

comment:2 Changed 8 years ago by timmywil

Component: unfiledattributes
Priority: undecidedlow
Resolution: duplicate
Status: newclosed

As the docs state, do not use removeProp to remove native properties. disabled should be set to boolean true or boolean false, not strings.

comment:3 Changed 8 years ago by timmywil

Duplicate of #9140.

Note: See TracTickets for help on using tickets.