gfranko / jquery.selectBoxIt.js

A jQuery Select Box Plugin for Mobile, Tablet, and Desktop
http://www.selectboxit.com
MIT License
852 stars 301 forks source link

Single Quotes in value #337

Closed joeykamsteeg closed 2 years ago

joeykamsteeg commented 9 years ago

Single quotes using in a value of a option will breaks the javascript execution. When using a single quote inside a option you can't open de select box anymore.

Error:

Uncaught Error: Syntax error, unrecognized expression: li[data-val='kilo's'] jquery.js:1453

jQuery version: 2.1.3

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/22809465-single-quotes-in-value?utm_campaign=plugin&utm_content=tracker%2F23157&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F23157&utm_medium=issues&utm_source=github).
sgengler commented 9 years ago

+1, this should be fixed, but can use ' in place of single quotes for values for the time being

lachlantweedie commented 8 years ago

Fixed this by changing line 1525 to this:

var currentElem = self.list.find("li[data-val=\"" + self.dropdownText.attr("data-val") + "\"]"),

kalleth commented 3 years ago

Awesome, thanks @lachlantweedie -- necroposting, I know, but your fix worked for me -- https://github.com/gfranko/jquery.selectBoxIt.js/pull/384 seems to include this fix too.

joeykamsteeg commented 2 years ago

Closed due inactive repository