Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Button: Fix for button bug #7505 #401

Closed
wants to merge 1 commit into from

3 participants

@epascarello

http://jqbug.com/ui/7505
Used regular expression to fix the radio button's name so it will not screw up the selector that it generates.

Button: escaped the radio element's name so certain characters do not break the selector. Fixed #7505 - Buttonset Bug when radio with name = "data['page']['parse']"

@epascarello epascarello Button: escaped the radio element's name so certain characters do not…
… break the selector. Fixed #7505 - Buttonset Bug when radio with name = "data['page']['parse']"
1315b81
@gnarf
Owner

I'm pretty sure that inside the quotes, you will only need to escape the ' Also, what backend is being used that likes data['page'] -- Just curious.

http://jsfiddle.net/gnarf/WBPFY/1/

Also, is there any chance we can add a unit test for this behavior?

Owner

A little more research into this issue, it seems that ' is the only character we will need to escape here. http://www.w3.org/TR/CSS2/syndata.html#tokenization http://jsfiddle.net/gnarf/WBPFY/3/

You are correct! Should have drank a few more cups of coffee this morning!

@gnarf
Owner

Can you update the pull to reflect that?

@jzaefferer
Owner

See also #754 - which replaces just the single quote.

@gnarf gnarf closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 22, 2011
  1. @epascarello

    Button: escaped the radio element's name so certain characters do not…

    epascarello authored
    … break the selector. Fixed #7505 - Buttonset Bug when radio with name = "data['page']['parse']"
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  ui/jquery.ui.button.js
View
2  ui/jquery.ui.button.js
@@ -24,7 +24,7 @@ var lastActive, startXPos, startYPos, clickDragged,
}, 1 );
},
radioGroup = function( radio ) {
- var name = radio.name,
+ var name = radio.name.replace(/([[\]:'])/g,"\\$1"),
form = radio.form,
radios = $( [] );
if ( name ) {
Something went wrong with that request. Please try again.