is it possible to have my RadioSelect to have extra text
I have this RadioSelect where I want to add "additional" content under my label, such as a description, kind of like help_text but there is multiple lines for each options. I am using the RadioSelect widget for my radio buttons. Is this possible or should I be doing something else here? Here is my code for my radioselect...
class UserDepartments(forms.Form):
DEPARTMENTS = (
('Physician', 'Physician'),
('FrontDesk', 'Front Desk'),
('Staff', 'Staff Pool'),
('Medi开发者_运维问答calEssentials', 'Medical Essential'),
)
department = forms.ChoiceField(widget=forms.RadioSelect, choices=DEPARTMENTS)
Here is the format I am looking to achieve...
o Physician
Short description #1
Short description #2
Short description #3
o FrontDesk
Another short description #1
Another short description #2
Another short description #3
I solved a similar problem for checkboxselectmultiple where I wanted to have a table row of data about each of the choices,
http://skyl.org/log/post/skyl/2011/01/wherein-the-inner-workings-of-the-deathstarwidget-are-revealed/
Essentially, you can subclass a widget and do whatever you want with the render method. I'd almost recommend just dealing with regular html and doing with the request.POST what you need to do though instead of haxing a widget up ... idk, the deathstarwidget has served me well though.
精彩评论