Update form.py with fieldsets?

86 views
Skip to first unread message

dou...@gmail.com

unread,
Jun 12, 2012, 9:09:58 PM6/12/12
to web.py
I edited my form.py to render with fieldsets and legends rather than
tables. Would anyone else be interested in this? It's (arguably)
better HTML practice, would there be any interest in moving this into
the main version of webpy? I'm happy to contribute if there's
interest. If not, well, no worries :)

Andrey Kuzmin

unread,
Jun 13, 2012, 4:57:02 AM6/13/12
to we...@googlegroups.com
Perhaps the best way to do so is by subclassing Form class instead of editing form.py.

dou...@gmail.com

unread,
Jun 13, 2012, 5:18:27 AM6/13/12
to web.py
Yeah, I thought about that as well, but I don't understand why it
would use tables as a default instead of fieldsets and I am not going
to use anything else, so this is easier for me. Except at upgrade
time, haha

-d

Dragan Espenschied

unread,
Jun 13, 2012, 6:53:47 AM6/13/12
to we...@googlegroups.com
I agree, tables are ancient practice, and because webpy uses them I never
bothered to use the built-in form functions. Would love to see this changed.
--
http://noobz.cc/
http://digitalfolklore.org/
http://contemporary-home-computing.org/1tb/

Shannon Cruey

unread,
Jun 13, 2012, 10:26:10 AM6/13/12
to we...@googlegroups.com
I'll add a question here and maybe learn something...

I still use ancient tables for one simple reason - alignment. With a table, a column of field labels are uniform width, and the inputs are all left aligned. Nice and pretty. No explicit width directive (or any style for that matter) required.

How, with legends and inputs, and without hardcoded element widths, can you achieve this same result?

S
> --
> You received this message because you are subscribed to the Google Groups "web.py" group.
> To post to this group, send email to we...@googlegroups.com.
> To unsubscribe from this group, send email to webpy+un...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/webpy?hl=en.
>

Andrey Kuzmin

unread,
Jun 13, 2012, 10:54:37 AM6/13/12
to we...@googlegroups.com
Yeah, this seem to be ancient, maybe it is left for the backward compatibility. 

But there is also render_css, that is tableless. I think anyone may have his own preferred way of form's html structure, its really impossible to have universal solution. So I go with the Form subclassing.

dou...@gmail.com

unread,
Jun 13, 2012, 11:12:17 PM6/13/12
to we...@googlegroups.com
Yes, that is true. To achieve the same results you do need display inline, text-align, plus width, so you do have a bit more CSS to write. But I just find tables to be such a pain that it's worth it, hahah.

Looks like this one is maybe better just left as-is.

On Wednesday, June 13, 2012 9:26:10 PM UTC+7, NSC wrote:
I'll add a question here and maybe learn something...

I still use ancient tables for one simple reason - alignment. With a table, a column of field labels are uniform width, and the inputs are all left aligned.  Nice and pretty.  No explicit width directive (or any style for that matter) required.

How, with legends and inputs, and without hardcoded element widths, can you achieve this same result?  

S



On Jun 13, 2012, at 6:53 AM, Dragan Espenschied  wrote:

> I agree, tables are ancient practice, and because webpy uses them I never
> bothered to use the built-in form functions. Would love to see this changed.
>
> Am 13.06.2012 03:09, schrieb
>> I edited my form.py to render with fieldsets and legends rather than
>> tables. Would anyone else be interested in this? It's (arguably)
>> better HTML practice, would there be any interest in moving this into
>> the main version of webpy? I'm happy to contribute if there's
>> interest. If not, well, no worries :)
>>
>
> --
> http://noobz.cc/
> http://digitalfolklore.org/
> http://contemporary-home-computing.org/1tb/
>
> --
> You received this message because you are subscribed to the Google Groups "web.py" group.
> To post to this group, send email to we...@googlegroups.com.
> To unsubscribe from this group, send email to webpy+unsubscribe@googlegroups.com.

Dragan Espenschied

unread,
Jun 20, 2012, 1:41:33 AM6/20/12
to we...@googlegroups.com
Look at the source of this very simple example:
http://www.csskarma.com/lab/contactForm/

Tomas Schertel

unread,
Jun 20, 2012, 9:28:59 AM6/20/12
to we...@googlegroups.com
Thanks drx.


On Wednesday, 20 June 2012 02:41:33 UTC-3, drx wrote:
Look at the source of this very simple example:
http://www.csskarma.com/lab/contactForm/


Am 13.06.2012 16:26, schrieb Shannon Cruey:
> I'll add a question here and maybe learn something...
>
> I still use ancient tables for one simple reason - alignment. With a table, a column of field labels are uniform width, and the inputs are all left aligned.  Nice and pretty.  No explicit width directive (or any style for that matter) required.
>
> How, with legends and inputs, and without hardcoded element widths, can you achieve this same result?  
>
> S
>
>
>
> On Jun 13, 2012, at 6:53 AM, Dragan Espenschied <d...@a-blast.org> wrote:
>
>> I agree, tables are ancient practice, and because webpy uses them I never
>> bothered to use the built-in form functions. Would love to see this changed.
>>
>> Am 13.06.2012 03:09, schrieb dou...@gmail.com:
>>> I edited my form.py to render with fieldsets and legends rather than
>>> tables. Would anyone else be interested in this? It's (arguably)
>>> better HTML practice, would there be any interest in moving this into
>>> the main version of webpy? I'm happy to contribute if there's
>>> interest. If not, well, no worries :)
>>>
>>
>> --
>> http://noobz.cc/
>> http://digitalfolklore.org/
>> http://contemporary-home-computing.org/1tb/
>>
>> --
>> You received this message because you are subscribed to the Google Groups "web.py" group.
>> To post to this group, send email to we...@googlegroups.com.
>> To unsubscribe from this group, send email to webpy+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages