On Jan 7, 2008 2:53 PM, lukaszt <[EMAIL PROTECTED]> wrote:
>
> Hi,
> Because I prefer to render forms another (not-a-table) way like...
> <dl>
> <dt><label for="sth">Sth:</label></dt>
> <dd><input type="text" name="something" id="sth" /></dd>
> </dt>
Yes, forms should be more flexible than what they are now.
> I wanted to ask if something like:
>
> web.config.form_parameters = dict(
> field_pre="<dl>",
> field_post="</dl>",
> label_pre="<dt>",
> label_post="</dt>",
> input_pre="<dd>",
> input_post="<dd>",
> note_pre="<dd>",
> note_post="<dd>"
> )
>
> or sth like this:
>
> web.config.form_templates = dict(
> field_tpl="<dl>|</dl>",
> label_tpl="<dt>|</dt>",
> input_tpl="<dd>|</dd>",
> note_tpl="<dd>|</dd>"
> ) # "|" char or any other method to substitute rendered inputs.
I think we should separate rendering from the form instead of
parameterizing rendering.
myform = form.Form(..., renderer=form.TableRenderer)
myform = form.Form(renderer=MyRenderer)
form.default_renderer = MyRenderer
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---