FancySelect
FancySelect copied to clipboard
Don't select an option start with "0"
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
By number, do you mean 'value'? Have you tried the 'includeBlank' option? (undocumented, so check the source code).
No I mean a number like: 01, 02. It accepts 1 or 2. The 0 before it is the problem.
but what exactly do you mean by number? could you provide some example code?
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.
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.