Vijay Ramachandran
2008-11-13 16:51:18 UTC
Hello.
I have a form with a checkbox (a terms of service), like this:
input id="tac_agree" name="tac_agree" type="checkbox" value="1" />
I would like to ensure that this box is checked in the validator schema.
What is the correct way to do this? I've tried many things - custom
validator which raises Invalid if the field is false, validators.NotEmpty,
chained_validators with a dummy field - nothing seems to work. I am not able
to propagate the Invalid exception back to the front end, the Schema
continues as though it didn't matter if tac_agree was checked or not.
thanks for your help,
Vijay
I have a form with a checkbox (a terms of service), like this:
input id="tac_agree" name="tac_agree" type="checkbox" value="1" />
I would like to ensure that this box is checked in the validator schema.
What is the correct way to do this? I've tried many things - custom
validator which raises Invalid if the field is false, validators.NotEmpty,
chained_validators with a dummy field - nothing seems to work. I am not able
to propagate the Invalid exception back to the front end, the Schema
continues as though it didn't matter if tac_agree was checked or not.
thanks for your help,
Vijay