Hello everyone.
I have found something that I want to discuss.
Using the Autocomplete Widget if I write in the field with this widget
the dropdown suggestion menu appears correctly but I have noticed the
widget submits the first value of that list but doesn't put the value
in the field. Example:
I have a model with
db.define_table('contacts',\
SQLField('name','string'),\
SQLField('notes','string')))
db.define_table('events',\
SQLField('when','datetime'),\
SQLField('who',db.contacts,requires =
IS_IN_DB(db,"contacts.id","contacts.name")))
db.events.who.widget = SQLFORM.widgets.autocomplete(request,
db.contacts.name, id_field=db.contactos.id)
Assuming I have Alexander in contacts if a write Alexis its work
propertly becouse the form returns an error (Alexis is not in the
Database) but if i write in that field Alex and I submit it I dont get
any error, the widget suposes that I meant Alexander but doesnt
modifies the field before the submit so its hard to detect. I think it
should returns the same error.
To fix this I can change line 518 in web2py/gluon/sqlhtml.py and
remove:
jQuery('#%(key3)s').val(jQuery('#%(key)s').val());
I want to know how to fix it without editing the web2py/gluon/
sqlhtml.py any sugestion?