Skip to main content

Bug Tracker

Side navigation

#8967 closed bug (worksforme)

Opened April 25, 2011 12:35PM UTC

Closed April 25, 2011 03:01PM UTC

Last modified April 29, 2011 08:12AM UTC

Selector [value=XXX] regress in 1.5.2

Reported by: Owned by:
Priority: low Milestone:
Component: selector Version: 1.5.2
Keywords: Cc:
Blocked by: Blocking:

Selector "SELECT[name=FOO] option[value=BAR]" works in 1.4.4 and doesn't work in 1.5.2

In 1.5.2 there's error:

Uncaught Syntax error, unrecognized expression:













I'm trying to append option to SELECT only if there isn't one there already:

function check_add(select_name, value) {
	if ($("SELECT[name=" + select_name + "] option[value=" + value + "]").length == 0) {
		$("SELECT[name=" + select_name + "]").append($("<option />").text(value || '').val(value || ''));

Using Chrome 10.0.648.205 under Windows XP.

Attachments (0)
Change History (7)

Changed April 25, 2011 02:47PM UTC by timmywil comment:1

component: unfiledselector
owner: →
priority: undecidedlow
status: newpending

Thanks for taking the time to contribute to the jQuery project! Please provide a reduced test case on that reproduces the issue experienced to help us assess your ticket.

Additionally, test against the jQuery (edge) version to ensure the issue still exists. I've created one here, but was unable to reproduce the issue described:

Changed April 25, 2011 03:01PM UTC by rwaldron comment:2

resolution: → worksforme
status: pendingclosed

Test in chrome 10 & 12 on windows XP:

Changed April 28, 2011 07:48AM UTC by comment:3

The problem exists:

Works in 1.4.4, doesn't work in 1.5.2 and edge:

"Syntax error, unrecognized expression: [value=D:\\Results\\BDS2007\\EXE\\TestEntityTransport.exe]"

Changed April 28, 2011 07:50AM UTC by comment:4

Sorry, the right link is:

Changed April 28, 2011 03:48PM UTC by timmywil comment:5

Quotes around the value are mandatory:

Changed April 28, 2011 04:43PM UTC by anonymous comment:6

I got the same error. After add quotes to the value in selector, the error msg went away. Thanks, timmywil.

Changed April 29, 2011 08:12AM UTC by comment:7

Forgot about quotes. Sorry, my mistake.