In your controller:

fields=[...]
form=SQLFORM(...,fields=fields)
form.vars.hiddenField = value


On 21 Kwi, 11:37, "web2py <<<at>>> technicalbloke.com"
<technicalbl...@googlemail.com> wrote:
> Hi All,
>
> I have table with a field that I don't want to show to the user
> however, I do want to set it to a value I receive in a (well vetted)
> get request. To this end I am calling SQLFORM with the list of fields
> I want rendered and deliberately missing that one out.
>
> I have tried storing the value in session and later injecting it
> directly into request.vars but the insert query (in fom.accepts)
> ignores it. It does insert all the other fields though.
>
> Is there some way to tell SQLFORM to hide this value and include it in
> the insert, or is there some way of adding it manually before calling
> form.accepts (or even passing it to form.accepts as a parameter) ???
>
> If there's no better alternative I suppose I could render the field
> and than use CSS to hide it, but even then I don't know how I would go
> about setting it's value to that of said GET variable :-/
>
> Roger Heathcote.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to