Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If an <option> element's value contains the " character, an incorrect value is stored in data-val #27

Closed
gavacho opened this issue Oct 9, 2012 · 3 comments
Assignees
Labels

Comments

@gavacho
Copy link

gavacho commented Oct 9, 2012

Pretty sure this is the line of code before-which special cases need to be handled

                // Uses Array.join instead of string concatenation for speed
                currentItem.push(optgroupElement + '<li id="' + index + '" data-val="' + this.value + '" data-disabled="' + dataDisabled + '" class="' + optgroupClass + '"><a><i class="' + iconClass + '"></i>' + $(this).text() + '</a></li>');
@gfranko
Copy link
Owner

gfranko commented Oct 9, 2012

Would you mind creating a jsbin or jsfiddle to show me when this would cause an issue? If the value of a select box option is correctly formatted, then I can't seem to wrap my head around when this would break.

@gavacho
Copy link
Author

gavacho commented Oct 9, 2012

Here ya go.

http://jsfiddle.net/gavacho/GNb6G/1/

(updated to include another example)

@gfranko
Copy link
Owner

gfranko commented Oct 9, 2012

I just updated SelectBoxIt so that it applies HTML attribute encoding for quotes inside of option values.

Here is your updated jsfiddle. Let me know if you run into any issues. Thanks!

@gfranko gfranko closed this as completed Oct 9, 2012
@gfranko gfranko self-assigned this Feb 19, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants