Hacker News new | ask | show | jobs
Show HN: FieldVal.js – JavaScript Validation Library (minoblog.io)
19 points by marcuslongmuir 4156 days ago
2 comments

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.

How's this?: http://codepen.io/MarcusLongmuir/pen/rawRKR

You could also write a custom check that used the previous result as documented here: http://www.fieldval.com/docs/fieldval/Check%20Functions

That's pretty slick. I'll put this library in my back pocket for later.
Great demo. Looks very useful and easy to use.