(SOLVED)
Anthony:
Thanks for your ideas. Finally I solved this:
Code:
1. form = SQLFORM.factory(
2. Field('numero', requires=IS_NOT_EMPTY()),
3. Field('fecha', 'datetime', requires=IS_NOT_EMPTY()),
4. Field('gasto', requires= IS_IN_SET(gastos_list,
multiple=(0,1))),
5. Field('unidad', requires=IS_NOT_EMPTY()),
6. Field('unidades_asignadas'),
7. Field('operador', requires=IS_IN_SET(operarios_list)),
8. Field('carta', requires=IS_NOT_EMPTY()),
9. Field('importe ($)', 'decimal(15,2)',
requires=IS_NOT_EMPTY()),
10. Field('observaciones'),
11. table_name="form_numeros",
12. _id="form_numeros" # id form
13. )
multiple=(0,1) was the solution.
And with a little help of jQuery I get the SELECT appears like a combo box.
In the view:
<script type="text/javascript">
jQuery(function(){
jQuery('#form_numeros_gasto').attr({ //form_numeros_gasto is the
id of the SELECT
size:20
});
});
</script>
Why I need a combobox with multiple=False?, Well, is for aesthetics.
Regards.
--
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.