I have the following form with radioselect options :
jobStatus = forms.ChoiceField( widget=forms.RadioSelect())
However, it renders the radio buttons in <ul> <li> .. </li></ul>
tags.
Could you suggest me any way to render the only radiobutton input ?
Thanks
This is a nice how-to for overriding the renderer of the radio select widget.
https://wikis.utexas.edu/display/~bm6432/Django-Modifying+RadioSelect+Widget+to+have+horizontal+buttons
Basically, create a class that inherits from the forms.RadioFieldRenderer class and override the render method. Then in your form when setting the widget use the renderer argument to set the renderer to your custom renderer class.
That being said, I usually just change the appearance using CSS
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With