Closed dper94 closed 7 years ago
Have you tried <option value={1999}>1999</option>
it may be passing it as a string and breaking it.
Also, why not filter through your options list and remove all dates greater than this.age? Why show the user an option they can't even select.
Thank you! i will try that later, i will post if that solve my issue :)
I try with <option value={1999}>1999</option>
and with <option value={"1999"}>1999</option>
and still doesnt work :( i try to put the element content as a number with <option value="1999">{1999}</option>
and nothing happens :/
Alright, I'll copy your code into CRA and debug it right now
Figured it out: https://github.com/skaterdav85/validatorjs#beforedate Before is for dates, not years which is just a number, you need to be using max:1999
instead :)
Hi guys, i discover react-validify yesterday and i have been playing around with it today, it is an awesome library but i have a problem, i have a Select wrapper component that takes multiple option tags with multiple years. I need the user to enter a year before 2000 so i use the rule "before:2000" but when i select option 1999 option it keeps saying to me "the select must be before 2000". I have try different rules but none seens to work.
this is how my Select component looks:
this is the complete form:
thanks in advance.