Reputation: 11833
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
Upvotes: 5
Views: 3248
Reputation: 39287
This is a nice how-to for overriding the renderer of the radio select widget.
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
Upvotes: 8