[web2py] Re: drop down box content depends of another drop box
I have exactly the same problem, did you find any solution? On May 11, 3:26 am, pepe_eloy pepe.e...@gmail.com wrote: Thanks for the answer. Yeah, I tried that solution, but when can I save in the table empresa the fields category and subcategoria only the categoria field has values. Why? Thanks
[web2py] Re: drop down box content depends of another drop box
search cascading select or cascading dropdowns On May 10, 1:24 pm, pepe_eloy pepe.e...@gmail.com wrote: Hello! How can I fill a drop box widget with content depends of another drop box? I'll explain better: I have 3 tables: db.define_table('categoria', SQLField('nombre', notnull=True), format='%(nombre)s') db.define_table('subcategoria', SQLField('categoria',db.categoria, label=Categoría), SQLField('nombre'), format='%(nombre)s') db.define_table('empresa', SQLField('categoria',db.categoria, label=Categoría), SQLField('subcategoria', db.subcategoria, label=Subcategoría), SQLField('nombre'), SQLField('contenido','text'), format='%(nombre)s') db.categoria.nombre.requires=[IS_NOT_EMPTY(), IS_NOT_IN_DB(db, db.categoria.nombre)] db.subcategoria.nombre.requires=[IS_NOT_EMPTY(), IS_NOT_IN_DB(db, db.subcategoria.nombre)] db.empresa.nombre.requires=[IS_NOT_EMPTY(), IS_NOT_IN_DB(db, db.empresa.nombre)] One categoria may have many subcategorias, and I'd like the contents of subcategorias change depending of the content of categoria, Somebody has any suggestion to do this? Thanks in advanced
[web2py] Re: drop down box content depends of another drop box
This should be of help: http://www.web2pyslices.com/main/slices/take_slice/85 On May 10, 1:24 am, pepe_eloy pepe.e...@gmail.com wrote: Hello! How can I fill a drop box widget with content depends of another drop box? I'll explain better: I have 3 tables: db.define_table('categoria', SQLField('nombre', notnull=True), format='%(nombre)s') db.define_table('subcategoria', SQLField('categoria',db.categoria, label=Categoría), SQLField('nombre'), format='%(nombre)s') db.define_table('empresa', SQLField('categoria',db.categoria, label=Categoría), SQLField('subcategoria', db.subcategoria, label=Subcategoría), SQLField('nombre'), SQLField('contenido','text'), format='%(nombre)s') db.categoria.nombre.requires=[IS_NOT_EMPTY(), IS_NOT_IN_DB(db, db.categoria.nombre)] db.subcategoria.nombre.requires=[IS_NOT_EMPTY(), IS_NOT_IN_DB(db, db.subcategoria.nombre)] db.empresa.nombre.requires=[IS_NOT_EMPTY(), IS_NOT_IN_DB(db, db.empresa.nombre)] One categoria may have many subcategorias, and I'd like the contents of subcategorias change depending of the content of categoria, Somebody has any suggestion to do this? Thanks in advanced
[web2py] Re: drop down box content depends of another drop box
Thanks for the answer. Yeah, I tried that solution, but when can I save in the table empresa the fields category and subcategoria only the categoria field has values. Why? Thanks