Show HN: FieldVal.js – JavaScript Validation Library (minoblog.io) 19 points by marcuslongmuir 11y ago ↗ HN
[–] cmpb 11y ago ↗ Looks useful! Could you provide an example of a field with validations depending on the value (or validation status) of another field?E.g., birth_month required if birth_year is set and after a certain year. [–] marcuslongmuir 11y ago ↗ How's this?: http://codepen.io/MarcusLongmuir/pen/rawRKRYou could also write a custom check that used the previous result as documented here: http://www.fieldval.com/docs/fieldval/Check%20Functions [–] cmpb 11y ago ↗ That's pretty slick. I'll put this library in my back pocket for later.
[–] marcuslongmuir 11y ago ↗ How's this?: http://codepen.io/MarcusLongmuir/pen/rawRKRYou could also write a custom check that used the previous result as documented here: http://www.fieldval.com/docs/fieldval/Check%20Functions [–] cmpb 11y ago ↗ That's pretty slick. I'll put this library in my back pocket for later.
4 comments
[ 0.21 ms ] story [ 17.4 ms ] threadE.g., birth_month required if birth_year is set and after a certain year.
You could also write a custom check that used the previous result as documented here: http://www.fieldval.com/docs/fieldval/Check%20Functions