Help: ensuring that a checkbox is checked

"Vijay Ramachandran" <[email protected]> Thu, 13 Nov 2008 22:21:18 +0530
Newsgroups gmane.comp.python.formencode
Message-ID <[email protected]>
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

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

_______________________________________________
FormEncode-discuss mailing list
FormEncode-discuss-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/formencode-discuss