Since you won't know the record type until after the form is submitted, it might be best to handle that with an onvalidation function: http://web2py.com/book/default/chapter/07#onvalidation
Anthony On Saturday, November 19, 2011 1:14:47 AM UTC-5, Jimmy Stewpot wrote: > > Hello, > > I am trying to figure out a way which I can have a select (drop down menu) > form, where based on the option that is selected the rest of the form > validators change. To try and explain it better here's the "example" I am > trying to work on. > > I am working on a web2py powerdns front end (to learn web2py).. In the > type form field I have > > TR("Type:", SELECT('A', 'CNAME', 'AAAA', 'MX', 'NS', 'TXT', _name='type', > value='yes', requires=IS_IN_SET(['A', 'CNAME', 'AAAA', 'MX', 'NS', > 'TXT']))), > > If the user selects A from the drop down menu I would like to have > requires=IS_IPV4() for the record type validator. > > Is it possible to do that? > > Thanks > > Jimmy. > >