Again, thanks Dave.

Seems if you do not use the full feature set of SQLFORM(factory) the
IS_IN_DB method does not work.

I was using the view to populate the form, but then simply using the
sqlform to get the values.

My way around this is something like this from the view:

<!-- Company you belong to : -->
{{isession.company_info = \
         db(db.company.company_number > '0').\
         select(db.company.company_number,db.company.company_name,\
         orderby=db.company.company_number) }} {{pass}}

<div class="select-container" >
  <select name='companyid' style='width: 20%'>
    <option value=''>--Please choose an option--</option>
    {{for comp in session.company_info:}}
<!-- Debug statement on next line -->
     {{print "VIEW MSQL COMPANY INFO 2: ID - %i  Name: %s" % (
comp.company_number, comp.company_name) }}
      <option
value='{{=comp.company_number}}'>'{{=comp.company_name}}'</option>
    {{pass}}
  </select>
</div>





*Ben Duncan*
DBA / Chief Software Architect
Mississippi State Supreme Court
Electronic Filing Division


On Tue, Feb 5, 2019 at 5:30 PM Dave S <snidely....@gmail.com> wrote:

>
>
> On Tuesday, February 5, 2019 at 4:31:33 AM UTC-8, Ben Duncan wrote:
>>
>> This is to have a drop down list appear.
>> Currently sqlform.factory works only if you have all the labels etc in
>> the sqlform.factory.
>>
>> I have a custom html using flex boxes and modal in the views but
>> following these instructions:
>>
>> http://web2py.com/books/default/chapter/29/07/forms-and-validators#SQLFORM-in-HTML
>>
>> Using IS_IN_DB doesn't work when included in the sqlform.factory ...
>>
>> *Ben Duncan*
>> DBA / Chief Software Architect
>> Mississippi State Supreme Court
>> Electronic Filing Division
>>
>>
> I'm going to defer to the experts, but I think you've explained your use
> case much better this time.
>
> /dps
>
>
> --
> 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.
>

-- 
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.

Reply via email to