yeah, 'class' is a special word in web.py's form impl
besides solution above, you may use:

f.get('content').class_ = 'some-class'

why? see the form.py source code

On Fri, Dec 26, 2008 at 9:29 AM, Brent Pedersen <[email protected]> wrote:

> >>> f.get('content').attrs['class'] = 'some-class'
> Does what you want, I think.
>
> On Dec 25, 2008 3:55 PM, "adelevie" <[email protected]> wrote:
>
>
> From a previous discussion, I was taught how to change the default
> value in a form like so:
> f.get('content').value="some content"
>
> I can change the id of the input field, too:
> f.get('content').id="some id"
>
> But I run into an obvious problem when trying to modify the class:
> f.get('content').class="some class"
>
> <obvious><dumbed down>This wont work as class is a "special" word in
> python</dumbed down></obvious>
>
> Is there a way to accomplish this?
> If not, is working with the Input class (and its subclasses) from
> web.template the place to (noobishly) hack in a solution?
>
> Thanks,
> Alan
>
>
> >
>


-- 
Su zhaohui   苏召辉

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web.py" 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/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to