You should probably use the default attribute of the HiddenField
instead of the attrs, that should work.

Also if you are using Sprox you can use __hide_fields__ = ['pid'] and
__field_widget_args__ : {'pid':{'default':123}} instead of setting the
pid field yourself.

Take a look at this EasyCrudRestController blog post for some infos
about customizing sprox forms, the used __form_options__ are available
also in Sprox forms: http://blog.axant.it/archives/423

On Sun, Jan 29, 2012 at 12:32 AM, Kai H. <[email protected]> wrote:
> Hello people,
>
> i have a question about a sprox AddRecordForm i am building for my TG2-
> App.
>
> I wonder how i can set a default-value for this field named "pid".
> pid = HiddenField('pid')
>
> I tried setting it via the attrs-arg
> pid = HiddenField('pid',attrs=dict(value="123"))
>
> Unfortunately that doesnt work as expected, because i get (using mako)
> <input type="hidden" id="pid" class="hiddenfield" name="pid" value=""
> value="123" />
>
> I hope somebody can help me!
>
> Thanks in advance,
>
> Kai
>
> --
> You received this message because you are subscribed to the Google Groups 
> "TurboGears" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/turbogears?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en.

Reply via email to