Its not INPUT. Its SELECT. See the code below. def get_shifts(): return ["1","2","3","G"]
shifts = get_shifts() form = FORM(TABLE( TR('AgtNo:',SELECT(_name='cmbAgtNo',_id='cmbAgtNo', requires=IS_NOT_EMPTY(),*[OPTION(str(x.agt_no) + x.work_desc,_value=x.id) for x in agts] )), TR('Jcod:',SELECT(_name='cmbJcod', _id='cmbJcod', requires=IS_NOT_EMPTY(), *[OPTION(x.jcod + '|' + x.job_desc, _value=x.jcod) for x in jobs])), TR('MeasDate:',INPUT(_type='text', _name='txtMeasDate' ,_id='txtMeasDate', _class='date', requires=IS_NOT_EMPTY() )), TR('Shift:',*SELECT*(_name='cmbShift', _id='cmbShift', requires=IS_NOT_EMPTY(),*[OPTION(x,_value=x) for x in shifts])), TR('',INPUT(_type='submit',_value='CreateMeas')) ))re... On Wednesday, November 26, 2014 5:17:13 AM UTC+5:30, Pablo Cruise wrote: > > I'm a novice Web2py programmer and I've searched the net but can't figure > this out. > > I've got a simple webpage with this form: > > > > > > > > > > > > * form = FORM(TABLE(TR (TH('BEG PLAN START DATE'), > INPUT(_name='begpstrtdt', _class='date', requires=IS_DATE(), _value=t0, > _style="width: 100px;")), (TH('END PLAN START DATE'), > INPUT(_name='endpstrtdt', _class='date', requires=IS_DATE(), _value=t0, > _style="width: 100px;")), TR('Group',INPUT(_name='group', > _id='group', , requires=IS_IN_SET(['YES', 'NO']))), > TR('Email Results?',INPUT(_name='emailflg', _id='emailflg', > _type='checkbox', _value='0')), TR('Show > Query?',INPUT(_name='qryflg', _id='qryflg', _type='checkbox', _value='1', > _checked="checked", > _onclick="if(jQuery('#qryflg').prop('checked')) jQuery('#qryinfo').show(); > else jQuery('#qryinfo').hide();")), TR('Show > Debug?',INPUT(_name='dbgflg', _id='dbgflg', _type='checkbox', _value='1', > _checked="checked", > _onclick="if(jQuery('#dbgflg').prop('checked')) jQuery('#dbginfo').show(); > else jQuery('#dbginfo').hide();")), > TR(INPUT(_type='submit',_value='Submit')) ))* > > > Everything works except I can't get the Group dropdown, 3rd element, to be > a dropdown menu. It shows up as a text field. > > 1. Is there an attribute I'm missing in the description? > 2. How would I get the selected value? > > I've seen many example using SQLFORM but I don't have a need for these > fields to be saved or retrieved to/from a database. > > Thanks, > Paul > -- 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.