I am not sure to understand exactly your issue, and your explanation are not as easy as a piece of code to understand... But maybe not "removing" you field from the form with readable and writable = False, but instead just hiding it with javascript could be of some help... The thing is that if you field is set to readable and writable = False you will not have this field in the form.vars so you can make any verification with your onvalidation function base on this field....
Hope it helps. Richard On Thu, Feb 6, 2014 at 11:17 AM, A36_Marty <ma...@mccaslandcorp.com> wrote: > > I've hit a roadblock and would appreciate a nudge in the right direction. > > I have a grid with a field I'd like to not show to the user. I've set the > "onvalidation" to call a function to check values, and depending on what > was entered in another field, add a separate value to the unseen/hidden > field on the grid.create/edit form. > > The db.table.field.default route before the grid call doesn't work because > I don't know the value needed for the field until after the user hits > submit and the 'onvalidation' code is run (it's a complex look, if nothing > is found during the lookup, a record is inserted in a seperate table, and > the id of the found/new record is placed in the hidden field). > > Likewise, if I set .readable=.writable=False to hide the field, I don't > see the field as an option in the response object inside the onvalidation > function... So that doesn't seem to be the way to accomplish the goal. > > Finally, I thought about adding the field to the response collections, > however, web2py is tagging the fields with keys to prevent > double-submission and I don't know how to generate a valid key after the > submit so as to programmatically add a new field in the mix for committing > to the db by the grid... > > Could someone point me in the right direction / design pattern to > accomplish the above? > > Many thanks in advance. > > -- > 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/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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.