You could perhaps subclass ChoiceField to allow for custom empty_labels.
This code is highly untested and written so casually it shouldn't be pasted
anywhere.
# your forms.py
from django.forms.fields import ChoiceField
class MyCustomChoiceField(ChoiceField):
def __init__(self, *args, **kwarg
On Thu, Dec 22, 2011 at 12:37 PM, talbronstien wrote:
> Hi,
>
> I want to have a field in a form class which will render as select in
> html. But, I want default text shown as "Select Blood Type". My
> declaration is
>
> gender = forms.ChoiceField(required=False,choices =
> USER_BLOOD_CHOICES).
>
Hi,
I want to have a field in a form class which will render as select in
html. But, I want default text shown as "Select Blood Type". My
declaration is
gender = forms.ChoiceField(required=False,choices =
USER_BLOOD_CHOICES).
But, if I add an option value in html, as Select
Blood Type". I get an
3 matches
Mail list logo