Michael schrieb: > When specifying the choices parameter is there a way to mark say, for > example, the first choice as invalid? > > e.g. > > TOPIC_CHOICES = ( > ('erroneous', '-- pick one --'), # <-- I would not want this > choice to count as being valid > ('general', 'General enquiry'), > ('bug', 'Bug report'), > ('suggestion', 'Suggestion'), > ) > > class ContactForm(forms.Form): > topic = forms.ChoiceField(choices=TOPIC_CHOICES) > TOPIC_CHOICES=[('', '-- pick one --'), ('key1', '...'), ...] And required=False for the ChoiceField (which is the default).
Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---