use a radio. https://docs.djangoproject.com/en/2.0/ref/forms/widgets/#radioselect
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/radio Only one radio button in a given group can be selected at the same time On Thursday, June 21, 2018 at 6:15:34 AM UTC-4, Sunil Kothiyal wrote: > > I want to show and hide text input box on checkbox selection. If someone > select business should show textbox. Otherwise hide it. > > > TWO_CHOICES = ( > ('1', 'Business'), > ('2', 'Indivitual'), > ) > > business_or_individual = forms.ChoiceField(required=True, > widget=forms.CheckboxSelectMultiple,choices=TWO_CHOICES) > > I and i am showing on the HTML form is > <form action="POST"> > {{form.contactInformation.business_or_individual}} > <input type="text" name="orgnization_name"> > </form> > Its showing-- > > > <https://lh3.googleusercontent.com/-oItcpUhE--I/Wyt6KWwiIpI/AAAAAAAAAOQ/ELorwlEgCeMILjDtXV9nxRSxpPvtwbKkwCLcBGAs/s1600/django.png> > > -- 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 django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. 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/cc986b50-899c-466b-a39a-2b1ffcfa8bfc%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.