Hello,
I have the form below and would like that when a user selects an equipment the page would reload with the equipment_id as an arg.
I know how to reload the page in javascript, but how can I add something similar to _OnClick (in this case a better name would be _OnSelect) to the drop-down list box created by the Field()?
And how can I pass the selected equipment_id to the javascript function?
form = SQLFORM.factory(
Field('code', label=T('WO Code'), requires=IS_EMPTY_OR(
IS_IN_DB(db(query), 'wo.code', distinct=True))),
Field('client_id',
label=T('Client'),
requires=IS_IN_DB(db, 'client.id', '%(name)s', zero=T('Choose one...')),
),
Field('equipment_id',
label=T('Equipment'),
requires=IS_IN_DB(db, 'equipment.id', '%(name)s', zero=T('Choose one...')),
),
...
Thanks,
JM