I'm using django forms to make a user registration form and it has two different types of users
I want that when selecting one of the types of user, in the html it shows registration information specific to that type of user
example: if I choose a doctor I will ask for his medical identification, if I choose a patient with a medical history
Like this
form.py
usertype= forms.ChoiceField( initial='----',choices=USER_TYPE_CHOICES ,widget=forms.Select(attrs={'class': 'form-control'}))
.html
<div class="row">
<div class="col-md-3 px-md-1">
<div class="form-group">
<label>User type</label>
{{form.usertype}}
</div>
</div>
</div>