I want a FORM that the select option from the 2nd field, depends on
the select option of the 1st field. This could be accomplished using a
jQuery function to change the available options.
However, the construction of the SQLFORM.factory SELECT Field, comes
with the "requires" command, which leaves no alternatives to play with
jQuery later.
For instance:

form=SQLFORM.factory(
    Field('method',requires=IS_IN_SET(['A','B'],zero=T('choose one'),
           error_message=T('select one of the methods'))  ),
     Field('units',requires=IS_IN_SET(['1','2'],zero=T('choose one'),
           error_message=T('select one of the units')))
           )

This presents the options '1' or '2', whatever option the user chooses
in the first Field. I want, if the user at the first Field chooses
'B', the available option for the second Field to be '1.1' or '1.2'.
Even if  I changed these options with jQuery, the validation rule
"requires" would produce an error...

What are my alternatives?

Reply via email to