Was min/max added to Abide's number validation (#4059)? It's supported by HTML5 validation, so it seems like Abide should handle it also.
It was also mentioned as being part of #4710 but never implemented. Is it possible to have it implemented?
Agreed this would be very very useful to have. Currently I have to regex pattern around this problem
@AdamBarnwell @jagexAllstar we are not adding features to F6, but this will definitely be considered for F7. Closing for now, but will reopen when the time comes to work on F7. Thanks!
@jagexAllstar , @AdamBarnwell how have you solved this issue with comparing the number input to min and max attributes? I the suggested custom validation pattern from the docs, but doesn't seem to work for me.
@lirael do you mean something like https://codepen.io/DanielRuf/pen/WMKebb?editors=0010 ?
@DanielRuf yep, thanks a lot, that is exactly what I was looking for! But I hope to make it work with Abide validation.
There is similar example in the docs, https://foundation.zurb.com/sites/docs/abide.html#adding-custom-pattern-and-validator
The example with 'dashes_only' works just fine, but 'greater_than' is giving me errors or just doesn't work after I fix them.
@DanielRuf you can check my code pen here, greater_than pattern always returns an error, though twelve works.
I've also tried to create a pattern which just returns True, but it displays an error too. So I think custom function within the validator should be implemented differently?
And I don't see a way to implement it with regex.
I also believe that in the docs $(document).foundation(); is misplaces, correct me if I'm wrong :)
I'll find a solution.
Do you need 6.3.1 or can you also use 6.4.3?
I needed for 6.3. and yep, that's exactly what I was looking for! Now I see my mistake, thanks a bunch! :)
So if I understand everything correctly, several improvements in the docs example https://foundation.zurb.com/sites/docs/abide.html#adding-custom-pattern-and-validator are needed?
Like $(document).foundation(); should be below the custom validation function (and actually below all custom validators), and this part $('#'+$el is wrong because $el is already a jquery selector.
this part $('#'+$el is wrong because $el is already a jquery selector.
The docs use an input with an ID as example. You can store the value anywhere as long as your custom validator can get it.
Regarding the docs and the initialization: can you open a new issue for this (so it is better instead of reopening or misusing this issue here for that)?
The docs use an input with an ID as example. You can store the value anywhere as long as your custom validator can get it.
I was a little bit confused because it is firstly $('#'+$el and then $el right on the next line.
I'll fix $(document).foundation() initialization in docs and will open PR for it now.
Most helpful comment
Agreed this would be very very useful to have. Currently I have to regex pattern around this problem