Ok!! Wy not use this plugin :
http://www.web2pyslices.com/slice/show/1616/widget-select-or-add-option-ng This slice is a derivatives of this original slice : http://www.web2pyslices.com/slice/show/1446/widget-select-or-add-option I had use the original successfully, I even modified it to allow tu use autocomplete widget with it, you can search the list if you need this functionnality... Hope it will be easier... There is also another way to do, if you use Tag-it widget... But it more dev, it is less plugs and play... What you have to do is creating a insert function in case the value don't exist that will insert in the referenced table... I am sure you can have more help here if you want to go that way... Richard On Thu, Feb 6, 2014 at 4:36 PM, A36_Marty <[email protected]> wrote: > Thanks Richard. > > Here's some simplified code to hopefully clarify what I'm trying to do: > > <Model> > db.define_table('record, Field('hidden_field'), Field('non_hidden_fields')) > > <Controller> > def index(): > grid = SQLFORM.grid(db.record, onvalidate=validate_form) > > def validate_form(form): > Check to values in non-hidden fields, do a fairly complex lookup, if a > record is found > in the lookup tables, stick the value in the "hidden_field", otherwise > add a record in > the lookup table and put the ID of the newly created record in the > "hidden_field" > > *And do all of the above with "hidden_field" never appearing to the user*, > yet still being able to be modified in the validate_form fx. > > I will do your Javascript hide approach if there's no other way to make > this happen. I just assume I was overlooking something.... > > Many thank, > Marty > > > -- > 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. > -- 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.

