I have a dialog for checking in a visitor. On submit I would like to check the database if values exists. I'm having some trouble building up the validator.
There are two tables.
table: visitor
- id
- name
- signed_agreement
- ...
table: visit_type
- id
- name
- require_agreement
While submitting the form I send two values; the visitor id and visit_type id. If the visit_type require_agreement column is equal to 1, the signed_agreement of the visitor should also be 1. If not, the validation should fail.
Any suggestions?