> In cookbook (http://webpy.org/cookbook/forms) it has only one
> validator, e.g. vpass, vemail. What's the best way to use multiple
> validators?
>
In the cookbook you can see that the validators parameter is passed as
list.
using the cookbook example you may do:
register_form = form.Form(
form.Textbox("username", description="Username"),
form.Textbox("email", vemail, description="E-Mail"),
form.Password("password", vpass, description="Password"),
form.Password("password2", description="Repeat password"),
form.Button("submit", type="submit", description="Register"),
validators = [
form.Validator("Passwords did't match", lambda i: i.password
== i.password2),
form.Validator("Username too short", lambda i: len(i.username)
<=3)]
)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web.py" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---