title: Manually set validation on form
body: <p>I have the following problem:</p>
  <p>I have a form with several fields. I use the function below to add more form fields to the form.</p>
  <p>It checks if the minimum number of filled form fields are present and have input. If this is the case, the submit button is activated.</p>
  <p>However, the submit button is disabled if the form is not valid.</p>
  <p>My question is how can I manually set the form to be valid?</p>
  <pre><code> addFormFieldsWithInput(fields: string[]): void {
     let controlArray=[];
      const groupObj = {};
          
             
              for (let i = 0; (i &lt; fields.length); i++) {
  
              controlArray.push((this.feedbackInviteForm.get(type) as FormArray).push(this.formBuilder.control(fields[i])));
                  this.formFieldsLength++;     
                  groupObj = this.formBuilder.array(controlArray);        
                      
              }
              
              if(fields.length&gt;=this.minFormFieldsLength){
                  this.form = this.formBuilder.group(groupObj)
                 
              }   
                          
              
          }  
  </code></pre>
  <p>With this implementation the button will be disabled and it adds the right amount of form fields but there is no input and the form fields are empty.</p>