Il 03/03/2011 08:14, Manuele Pesenti ha scritto:
Hi *,
I got an sqlform created with SQLFORM.factory and I want to assign a
validator to a field of theirs that depend to the value of another
field so I have do asign validators outside the form definition such
as is done in this example I found that use a table:
db.define_table('t','Field('a'),Field('b'))
db.t.a.requires=IS_NOT_EMPTY()
db.t.b.requires=IS_EXPR('value==%s' % repr(request.vars.a))
in particular my problem is that I need that if the field "a" is null
even "b" has to be null and vice versa... alternatively the second field
could be activated only if the first is not null.
thank again
Manuele