Niphold, thanks for that info, but this is what I have;
db.define_table(
'order_bus',
Field('depart_from'),
Field('arrive_to'),
Field('date', 'date'),
Field('time', db.depature_times), # drop-down select time options
Field('no_of_passengers', db.tickets), # drop-down options to select
number of positions
Field('posted_on', 'datetime', readable=False, writable=False),
Field('posted_by', readable=False, writable=False))
db.order_bus.depart_from.widget = SQLFORM.widgets.autocomplete(request, db.
route.city, id_field=db.route.id, limitby=(0,10), min_length=2)
db.order_bus.arrive_to.widget = SQLFORM.widgets.autocomplete(request, db.
route.city, id_field=db.route.id, limitby=(0,10), min_length=2)
I like to point out that something very strange happens;
When I select the depart_from and arrive_to fields, the auto complete
options appear, and then I can choose a city. When the form is submitted,
the route.id for the arrive_to field that was selected on the form, appears
in the depart_from column in the order_bus db table. In addition to that,
the arrive_to db table table shows 0. So I am not sure as what is really
going on.
On Sunday, November 10, 2013 6:02:23 PM UTC-5, Niphlod wrote:
>
> after two days of bashing your head to the wall, why don't you read the
> docs about the autocomplete widget ?
> You need to pass the id_field argument....
>
>
> http://web2py.com/books/default/chapter/29/07/forms-and-validators?search=autocomplete#Autocomplete-widget
>
> On Sunday, November 10, 2013 9:56:46 PM UTC+1, raferbop wrote:
>>
>> When I remove the auto complete widget, the data saves in the database is
>> it should.
>>
>>
--
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/groups/opt_out.