Ticket #5179 (closed defect: fixed)

Opened 14 months ago

Last modified 6 months ago

dojo.query :selected does not work

Reported by: guest Owned by: alex
Priority: normal Milestone: 1.2
Component: General Version: 1.0
Severity: normal Keywords: query checked
Cc:

Description (last modified by alex) (diff)

The following code returns EVERY input element within a form not just the input elements that are checked (which would make them type=checkbox too)

Accourding to the Dojo documentation HERE it is suppose to return only the Checked elements.

var form = dojo.byId( 'formID' );

var results = dojo.query( "input:checked", form );

I also tried this:

var form = dojo.byId( 'formID' );

var results = dojo.query( "input[type=checkbox][checked]", form );

But it did not return any elements.

Change History

Changed 14 months ago by guest

The title is a little confusing -- I meant to mention that both the :selected and the :checked are broken in this regard.

Changed 14 months ago by guest

I found the following comment in dojo.query -- I believe we should make this information known in the Documentation on Query so others like me don't waste their time trying to figure out why they don't work.

		//		Unsupported Selectors:
		//		--------------------
		//
		//		While dojo.query handles many CSS3 selectors, some fall outside of
		//		what's resaonable for a programmatic node querying engine to
		//		handle. Currently unsupported selectors include:
		//		
		//			* namespace-differentiated selectors of any form
		//			* "~", the immediately preceeded-by sibling selector
		//			* "+", the preceeded-by sibling selector
		//			* all "::" pseduo-element selectors
		//			* certain pseduo-selectors which don't get a lot of day-to-day use:
		//				* :root, :lang(), :target, :focus
		//			* all visual and state selectors:
		//				* :root, :active, :hover, :visisted, :link, :enabled, :disabled, :checked
		//			* :*-of-type pseudo selectors

Changed 14 months ago by peller

  • owner changed from anonymous to alex

Changed 11 months ago by dylan

  • milestone set to 1.1

Changed 10 months ago by bill

  • milestone changed from 1.1 to 1.2

Move all milestone 1.1 tickets to 1.2, except for reopened tickets and tickets opened after 1.1RC1 was released.

Changed 6 months ago by alex

  • status changed from new to closed
  • resolution set to fixed

(In [14408]) adding support for the ":checked" pseudo selector. Fixes #5179. !strict

Changed 6 months ago by alex

  • description modified (diff)

note that the CSS 3 working draft has removed the ":selected" pseudo-class in favor of ":checked", which we now implement

Note: See TracTickets for help on using tickets.