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?