Found the solution.

form.element('#no_table_equipment_id')['_OnChange'] = 
'reload_page(this.value);'




sexta-feira, 22 de Março de 2019 às 13:25:36 UTC, João Matos escreveu:
>
> 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
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.

Reply via email to