I'm trying to add a hidden form to a SQLFORM using the sample code on p. 
331 of the 4th edition book (pdf):

form.vars.a = request.vars.a
form = SQLFORM(..., hidden=dict(a='b'))

When I submit the form, though, I get an error because I'm calling the 
variable 'form' before assignment. If I reverse the order of these two 
lines (so that form is declared first) the form doesn't process the hidden 
field. 

My workaround was to write an onvalidation method that adds the hidden form 
during processing. But this feels like a hack. Is this really an error, or 
am I just missing something?

Reply via email to