Ok I have committed a change so label cells now use <th /> rather than
<td />. This may change the look of some peoples forms as the default
browser style of <th /> is bold and centred but I'm sure most know css
well enough to overwrite it with the selector th{ font-weight: normal;
text-align: left; }
As discussed here it allows for much better control over styling the
form. I would like to make some other changes but they need to be
discussed so as not to break things. For example the ListForm should
perhaps be more like this:
class ListForm(Form):
template = """
<form xmlns:py="http://purl.org/kid/ns#"
name="${name}"
action="${action}"
method="${method}"
py:attrs="form_attrs"
>
<div py:for="field in hidden_fields"
py:replace="field.display(value_for(field),
**options_for(field))"
/>
<ul>
<li py:for="field in fields">
<dl>
<dt>
<label class="fieldlabel"
for="${field.field_id}" py:content="field.label" />
<span py:if="field.help_text"
class="fieldhelp" py:content="field.help_text" />
<span py:if="error_for(field)"
class="fielderror" py:content="error_for(field)" />
</dt>
<dd>
<span
py:replace="field.display(value_for(field), **options_for(field))" />
</dd>
</dl>
</li>
<li py:content="submit.display(submit_text)" />
</ul>
</form>
"""
I would also like to provide a way of marking a field as required, is
it possible to check the validator and add a css class?
The other thing I was thinking was a way to specify a cancel url, and
add a link next to the submit button to cancel.
Michele Cella wrote:
> Hi Richard,
>
> I think you're right, since you're also a great designer if you can
> send here a revamped form template (even for ListForm?) that you feel
> is easier for designers to style I will commit it without a problem, or
> you can do it yourself since you have commit access right?
>
> Thanks!! ;-)
>
> Ciao
> Michele
ta.
Rich
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears Trunk" 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-trunk
-~----------~----~----~----~------~----~------~--~---