after reading: https://groups.google.com/group/web2py/browse_frm/thread/bd7b06b759c9b4ae
It looks like what I can do is this: db.Dinners.Latitude.widget=lambda field,value:SQLFORM.widgets.StringWidget.widget(field,value,_type="hidden") Will this work? I'll test when I get home tonight. On Aug 7, 10:21 pm, Rob <[email protected]> wrote: > I have a model that has a 'Address', 'Lat' and "Lon' field. When the > user enters an address, some javascript currently populates the 'Lat' > and 'Lon' fields and they get inserted into the DB via crud.create() > or crud.update(). > > How do I hide these fields from the user, but allow the JS to insert > the correct values? Idealy, I would like to turn these fields from > input fields to hidden fields. > > Possible? > > just for reference: > model: > db.define_table('Dinners', > Field('Address', requires=IS_NOT_EMPTY()), > Field('Latitude', 'double'), # <== I want this to be a hidden > field > Field('Longitude', 'double')) # <== I want this to be a hidden > field > > controller: > def Create(): > crud.settings.formstyle='table2cols' > form = crud.create(db.Dinners) > return dict(form=form) > > view: > {{=form}} > > Thanks!

