The documentation suggests you can compare fields when validation a form by 
referring to the form elements as attributes:


signup = form.Form(
    form.Textbox('username'),
    form.Password('password'),
    form.Password('password_again'),
    validators = [form.Validator("Passwords didn't match.", lambda i: 
i.password == i.password_again)]
)

But this doesn't appear to be right.  The only way to access the individual 
field elements if by referring to them as keys:

signup = form.Form(
    form.Textbox('username'),
    form.Password('password'),
    form.Password('password_again'),
    validators = [form.Validator("Passwords didn't match.", lambda i: 
i['password'] == i['password_again']]
)

Is this correct or am I missing something?  

This post from Anand back in 2007 indicates it *could* be possible: 

https://groups.google.com/forum/#!searchin/webpy/validator/webpy/ibMOuTNesBg/NhLXJZfl8ekJ

but maybe it was never implemented?


-- 
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/webpy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to