FancySelect icon indicating copy to clipboard operation
FancySelect copied to clipboard

Don't select an option start with "0"

Open rakker1985 opened this issue 11 years ago • 5 comments

Hello,

I'm currently trying to implement the fancy select jQuery plugin. I run into a problem. It seems the script don't accept a number start with a "0". I want to add the script as a way to select a time range from 0 to 60 minutes.

How can I solve this?

Thanks in advance.

Kind regards,

Stefan van Daalen

rakker1985 avatar Jul 14 '14 18:07 rakker1985

By number, do you mean 'value'? Have you tried the 'includeBlank' option? (undocumented, so check the source code).

emwee avatar Jul 25 '14 09:07 emwee

No I mean a number like: 01, 02. It accepts 1 or 2. The 0 before it is the problem.

rakker1985 avatar Jul 25 '14 09:07 rakker1985

but what exactly do you mean by number? could you provide some example code?

emwee avatar Jul 25 '14 13:07 emwee

I'm having this issue too. So if you have a select for say month. If your values for your months are: 01, 02, 03 etc. Then fancyselect doesn't work. If you remove the leading 0 from your values, eg. 1, 2, 3 etc then it does.

dahliacreative avatar Aug 01 '14 10:08 dahliacreative

Presumably this is happening because of these lines: https://github.com/octopuscreative/FancySelect/blob/master/fancySelect.coffee#L184-L186

Would someone mind checking if opt.val().toString() fixes the issue? I'd gladly accept a PR if that does the trick.

paulstraw avatar Aug 01 '14 10:08 paulstraw