let's say i want to use a selector that uses a literal string, like the attribute selector...

fieldset[name*='some-name']

this doesn't seem to be possible as the selector seems to be modified or something. i mean, it looks like as soon as it hits the quote just before the 's', that it thinks it is the end. replacing the single quotes with doubles generates a different error. what am i doing wrong?

Comments

jrockowitz’s picture

You will have to look at jQuery's documentation to figure out how to escape special characters.

From -- http://api.jquery.com/category/selectors/

If you wish to use any of the meta-characters (#;&,.+*~':"!^$[]()=>|/@ ) as a literal part of a name, you must escape the character with two backslashes: \\. For example, if you have an an input with name="names[]", you can use the selector $("input[name=names\\[\\]]").

I think just using fieldset[name*=some-name] should work since dashes are not listed as a meta character.

Hope this helps,
~jake

rconstantine’s picture

hmm. didn't work. oh well. i was trying to figure out how to exclude the text filter fieldsets from opening/closing.

i tried this selector:

fieldset:not('fieldset[id*=fieldset-input-format]') or something like that.

jrockowitz’s picture

Status: Active » Fixed

Closing old tickets if you still need please re-open this ticket.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.