Use the OPTION() helper to create options, and pass them to SELECT(). SELECT(OPTION('option 1'), OPTION('option 2'), ...)
If the options should have submitted values that are different from their displayed values, you can set the _value attribute separately. If you have an existing list, you can create the options programmatically: SELECT([OPTION(option) for option in list_of_options]) In fact, if you don't need to set the _value attributes separately, you can just pass a list of options directly to SELECT, and each item will automatically be wrapped in an OPTION helper: SELECT(list_of_options) Anthony On Monday, May 12, 2014 5:58:04 PM UTC-4, Trend Codax wrote: > > Hey guys, > I have a form, a SQL Form. I'm adding an element, a select element. But > how can i add Options to this element? > > > form = SQLFORM(dba.account_directory) > my_extra_element = TR(LABEL('Country'), SELECT(_name='country')) > form[0].insert(-1,my_extra_element) > > > Thanks ;) > -- 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.