Hi,

i have code like this.

    fields.append(Field("m_class_id", "reference asset_class",
                        required=True,
                        requires=IS_IN_DB(db, 'asset_class.id', '%(name)s',zero
=T("-- Odaberite --")),
                        label=LABEL("M CLASS", _for="no_table_m_class_id")))


    if request.env.request_method == "POST" and request.post_vars.m_class_id
:
        fields.append(Field("m_id", "reference asset",
                            required=True,
                            requires=IS_IN_DB(db(db.asset.asset_class_id 
==request
.post_vars.m_class_id), 'asset.id', '%(asset_label)s', zero=T("-- Odaberite 
--")),
                            label=LABEL("M", _for="no_table_m_id")))
    else:
        fields.append(Field("m_id", "reference asset",
                            required=True,
                            requires=IS_IN_DB(db, 'asset.id', 
'%(asset_label)s', zero=T("---")),
                            label=LABEL("M", _for="no_table_m_id")))


I am trying to make dependent selects. This means when i change m_class_id 
the m_id is populated based on m_class_id. I do this with jQuery and i 
don't have problems there. 
I want to make something like this, when user visits the form, he will see 
only two selects, M CLASS - this is initial select, M ID - this one is 
dependent on M CLASS and is populated only if M CLASS value is present, in 
M ID i want to have requires=IS_IN_DB(db, 'asset.id', '%(asset_label)s',
 zero=T("---")) validator but with empty select initially, something like 
in the code above.


-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to