Skip to main content

Bug Tracker

Side navigation

#7441 closed feature (wontfix)

Opened November 08, 2010 08:50PM UTC

Closed June 06, 2011 06:58PM UTC

Add .disable() and .check() methods

Reported by: john Owned by: john
Priority: low Milestone: 1.7
Component: attributes Version: 1.4.3
Keywords: Cc:
Blocked by: Blocking:

These would be very useful (a quick map on top of .attr() and also for mapping to UI widget factory disabling, etc.).

Attachments (0)
Change History (21)

Changed November 08, 2010 08:51PM UTC by john comment:1

component: unfiledattributes
owner: → john
status: newassigned

Changed November 08, 2010 08:53PM UTC by rwaldron comment:2

status: assignedpending

Thanks for taking the time to contribute to the jQuery project! Please provide a jsFiddle that outlines practical use cases for your enhancement request.

Changed November 08, 2010 09:06PM UTC by john comment:3

status: pendingassigned

Changed November 08, 2010 09:12PM UTC by rwaldron comment:4

milestone: 1.5
priority: undecidedlow

Thanks, I've forked the fiddle and have a few brainstorming questions that I've noted in the code as comments.

Changed November 08, 2010 09:23PM UTC by rwaldron comment:5

Per discussion: This feature provides a convenience method for disabling/enabling form elements that support the disabled property, as well as any plugins that support listening for triggered "disabled" or "enabled" events.

(fixed a typo with trigger("enabled") )

Changed November 09, 2010 12:34AM UTC by snover comment:6

Will there also be convenience functions for detecting/modifying checked and selected elements as part of this change?

Changed November 24, 2010 05:01PM UTC by dmethvin comment:7

I'd like to see this done a bit differently, with a single .disable(boolean) method. Otherwise the code will often look like $("#thing")[cond?"enable":"disable"]();

Changed April 15, 2011 03:37AM UTC by timmywil comment:8

keywords: → needsreview

Changed April 16, 2011 09:08PM UTC by john comment:9

milestone: →

We should consider this for 1.7.

I think the problem of check()/select() is different - as both of those can (and probably should) be manipulated through .val().

Changed May 10, 2011 08:37PM UTC by timmywil comment:10

#9189 is a duplicate of this ticket.

Changed May 10, 2011 08:49PM UTC by timmywil comment:11

Select should be manipulated through val. Check can't be though. I'm not sure how I feel about all this. It's a little too easy to do this with raw javascript, but this might be something more in dave's direction:

Changed May 22, 2011 07:13PM UTC by john comment:12

summary: Add .disable()/.enable()Add .disable() and .check() methods

Changed May 22, 2011 07:27PM UTC by john comment:13

keywords: needsreviewneedsreview,1.7-discuss

Nominating ticket for 1.7 discussion.

Changed May 22, 2011 09:35PM UTC by rwaldron comment:14


Changed May 23, 2011 12:21AM UTC by jaubourg comment:15

-1, again, let's make an official plugin with all those helpers and let's not clobber core anymore than it needs to.

Changed May 23, 2011 04:01AM UTC by timmywil comment:16

+0, disable could be convenient. I've gravitated towards against doing .check at all though.

Changed June 03, 2011 01:43PM UTC by john comment:17

-1, Don't think this is really needed much anymore, given that we have .attr("checked", true) working.

Changed June 03, 2011 03:40PM UTC by scottgonzalez comment:18

-1, I don't think we need help methods for every little thing, these are already straight-forward with existing APIs

Changed June 05, 2011 09:01PM UTC by ajpiano comment:19

_comment0: +1, I've been really unclear of the utility of these to begin with1307307739474094

-1, I've been really unclear of the utility of these to begin with

Changed June 06, 2011 03:59PM UTC by jzaefferer comment:20


Changed June 06, 2011 06:58PM UTC by rwaldron comment:21

keywords: needsreview,1.7-discuss
milestone: 1.next1.7
resolution: → wontfix
status: assignedclosed

We recommend using attr()