Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-field validation #7

Closed
keisans opened this issue Aug 28, 2015 · 3 comments
Closed

Multi-field validation #7

keisans opened this issue Aug 28, 2015 · 3 comments

Comments

@keisans
Copy link

keisans commented Aug 28, 2015

When validating a form, it would be convenient if there were a way to validate against multiple different fields. An example might be a date-range input with a start date and an end date. The form would be invalid if the end date came before the start date, even though both fields might be valid independently.

@andrewhathaway
Copy link
Owner

Great idea.

First part of adding this feature is to think of the suitable schema format for this.

Any suggestions off the bat? I'll try to think of something meanwhile!

@andrewhathaway
Copy link
Owner

Hi @keisans! Also @VinSpee

I've been thinking about this, and we'd need a way of distinguishing between a normal value and a questionId (to get its answer). Whilst it needs to be simple, it also needs to be nice.

I've been thinking, and how would you guys feel about variations or some of the following:

{questionId}
${questionId}
:questionId
$questionId

Using these characters, we could decide whether its a questions-value we need to pull, or just a normal value.

Any other suggestions would be great!

andrewhathaway added a commit that referenced this issue Sep 14, 2015
andrewhathaway added a commit that referenced this issue Sep 15, 2015
…ed logic to parse the right vaidationParameter-items, but only if they are strings (to prevent JS errors) - #7
@andrewhathaway
Copy link
Owner

Master now has this, check the README for details. Will push a new version soon to npm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants