OK, that's all the code, demonstrating the problem. It is not much
different from the original:

import cherrypy
import turbogears
from turbogears import controllers
from turbogears import identity
from turbogears import widgets
from turbogears import validators

class MySchema(validators.Schema):
    pwd1 = validators.Int()
    pwd2 = validators.Int()
    pwd3 = validators.String(not_empty=True , max=5)
    chained_validators = [validators.FieldsMatch('pwd1', 'pwd2'), ]

def createPasswordForm(controller=None):
    field1 = widgets.PasswordField('pwd1')
    field2 = widgets.TextField('pwd2')
    field3 = widgets.TextField('pwd3')
    form = widgets.TableForm(fields=[field1, field2, field3],
                             name='myform', validator=MySchema())
    return form

class FormTest(controllers.Controller):
    @turbogears.expose(template="turbogears.fastdata.templates.form")
    def index(self, tg_errors=None, **kw):
        turbogears.flash(tg_errors)
        return dict(obj=None, action='test', form=createPasswordForm())

    @turbogears.expose()
    @turbogears.error_handler(index)
    @turbogears.validate(form=createPasswordForm)
    def test(self, pwd1, pwd2, pwd3=None):
        return "Password1: %s<br />Password2: %s" % (pwd1, pwd2)


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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/turbogears
-~----------~----~----~----~------~----~------~--~---

Reply via email to