title: Django form field required on condition
body: <p>I have a Django model form where i want to make a form field required if some value is selected in another form field.</p>
  
  <p>e.g 
  if activity_name = 'Project Planned Activities' is selected in activity_name form field the project_id field should be required = true </p>
  
  <p>I have added a form validator for this but its not working</p>
  
  <pre><code>class ActivityTrackerModelForm(forms.ModelForm):
      activity_name = forms.ModelChoiceField(
          queryset=activity.objects.all().order_by('activity_name'),
          label='', 
          empty_label="Select Activity", 
          widget=forms.Select(
              attrs={
              'class': 'form-control',
              }
              )
          )
      project_id = forms.CharField(
          label='', 
          required=False, 
          widget=forms.TextInput(
          attrs={
              "placeholder": "Project ID", 
              'class': 'form-control'
              }
              )
          )
  
      class Meta:
          model = activity_tracker
          fields = ['activity_name', 'project_id']
  
  
      def clean(self):
          activity = self.cleaned_data.get('activity_name')
          if re.search("^Project.*Activities$", str(activity)):
              self.fields['project_id'].required = True
  
  </code></pre>
  
  <p>Tried using the form validator</p>
  
  <p>if activity_name = 'Project Planned Activities' is selected in activity_name form field the project_id field should be required = true</p>