Inserting br tag after each input type="radio"

52 views
Skip to first unread message

Brendan Sleight

unread,
Dec 30, 2012, 10:32:01 AM12/30/12
to we...@googlegroups.com
Hi,

It seams like a trivial problem, either my google-foo is not up to standard, or I am missing easy.

I have the following code:-
myform = form.Form( 
    form.Radio('foobar', 
        ['Foo', 'bar', ], 
        description="Foobar to report:"),
    form.Textarea('more', description="More details:", rows=4,cols=40),
    )

Which generates:-
<table>
    <tr><th><label for="foobar">Foobar to report:</label></th><td><span><input type="radio" id="foobar" value="Foo" name="foobar"/> Foo<input type="radio" id="foobar" value="bar" name="foobar"/> bar</span></td></tr>
    <tr><th><label for="more">More details:</label></th><td><textarea rows="4" cols="40" name="more" id="more"></textarea></td></tr>
</table>

I would like to insert a <br/> in to every input type="radio":-

<table>
    <tr><th><label for="foobar">Foobar to report:</label></th><td><span><input type="radio" id="foobar" value="Foo" name="foobar"/> Foo<br/><input type="radio" id="foobar" value="bar" name="foobar"/> bar<br/></span></td></tr>
    <tr><th><label for="more">More details:</label></th><td><textarea rows="4" cols="40" name="more" id="more"></textarea></td></tr>
</table>

Is there a simple way of doing this in web.py ?

Thanks for any help,
Brendan 

Marios Zindilis

unread,
Dec 31, 2012, 1:25:12 AM12/31/12
to we...@googlegroups.com
There is the "post" parameter to any form element, as described in http://webpy.org/form (see the "Input Features" paragraph). You can include any string in there, arbitraty HTML too, that will appear after the element, but I don't think this is what you want in your case.

This is probably something that you should do with CSS, surely it can be done with web.py but probably it's not worth it, as it's purely presentational.



--
You received this message because you are subscribed to the Google Groups "web.py" group.
To view this discussion on the web visit https://groups.google.com/d/msg/webpy/-/KMaJ71H2iz8J.
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.



--
Marios Zindilis
Reply all
Reply to author
Forward
0 new messages