Skip to main content

Bug Tracker

Side navigation

#9609 closed bug (duplicate)

Opened June 17, 2011 02:42PM UTC

Closed June 17, 2011 09:23PM UTC

Last modified March 14, 2012 03:42AM UTC

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.

Attachments (0)
Change History (3)

Changed June 17, 2011 02:47PM UTC by anonymous comment:1

Max OS X 10.6.7, Chrome 12.0.742.100

Changed June 17, 2011 09:23PM UTC by timmywil comment:2

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.

Changed June 17, 2011 09:23PM UTC by timmywil comment:3

Duplicate of #9140.