Hi all,
I'm working on a form that has to support a few groups of radio buttons.
I'm wondering if there is a recommended way to do an "other" radio button
that can be dynamically set by the user. Like the user can select the
"other" radio button and enter a custom string to be associated with their
"other" selection. My model is set up like this:
GENDER_CHOICES = (
('M', 'Man'),
('W', 'Woman'),
('N', 'Prefer not to answer'),
('O', 'Other'),
)
gender = models.CharField(
max_length=1,
choices=GENDER_CHOICES,
default='',
blank=True
)
This is good but I would like for the user to be able to define what string
the "O" choice points to. Kinda like this from a google doc:
<https://lh3.googleusercontent.com/-wc4dNjH7Zkw/WDjMgbyhabI/AAAAAAAAA0Q/ydfXuNSf1ekzog5MgRzZTRtQDcBPBpPbQCLcB/s1600/form-ex.png>
Is there an easy way to do this with django forms?
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/509a9340-1cbf-4999-84fa-c705b45e4bda%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.