Superscript in the choice list of Field.choices.

10 views
Skip to first unread message

voss

unread,
Nov 18, 2011, 4:22:31 PM11/18/11
to django...@googlegroups.com
Hello all,

I have a form that looks like this:

MY_CHOICES = (('A', 'x^y = z'), ('B', 'y^z = x'),)

class MyForm(forms.Form):

my_choice_field = forms.MultipleChoiceField(widget=forms.CheckboxSelectMultiple(), choices=MY_CHOICES)

My question is: is it possible to display the power in superscript? That is, when outputting in HTML, it looks like

<li><label for="id_my_choice_filed_0"><input type="radio" id="id_my_choice_field_0" value="A" name="my_choice_field" /> x<sup>y</sup> = z</label></li>
<li><label for="id_my_choice_filed_1"><input type="radio" id="id_my_choice_field_1" value="A" name="my_choice_field" /> y<sup>x</sup> = x</label></li>.

Thank you!





Reply all
Reply to author
Forward
0 new messages