0

I have the following input and works normally to save

<input id="field_dataAtivacao" type="text" class="form-control" name="dataAtivacao"
               ngbDatepicker #dataAtivacaoDp="ngbDatepicker" formControlName="dataAtivacao"
               [value]="dataAtivacao | date:'dd/MM/yyyy'" placeholder="00/00/0000"
               [disabled]="false" [readonly]="true" />

Form control

  editForm = this.fb.group({
        dataAtivacao: [],
    });

The value that comes from cliente.dataAtivacao is a normal date using this format 00/00/0000. It is loaded when the user click to edit.

this.editForm.patchValue({
      dataAtivacao: cliente.dataAtivacao,
});

The issue occurs when I need to update the value of form control because the button is enable only when I click in input and set date again but I need to update without click again to set a date because the date already was loaded.

<button type="submit" id="save-entity"
        [disabled]="editForm.invalid" class="btn btn-primary">
        <span>Save</span>
</button>
renanvm
  • 208
  • 3
  • 16

0 Answers0