exploring the intricacies of design decisions, sub systems, frameworks, and libraries
Hello! I am relatively new to Angular and have encountered a puzzling issue that I can't quite figure out. I could easily create a lengthy if statement to address it, but I wouldn't gain any valuable insights. The problem at hand involves a large form divided into 4 sections, each containing 5 input fields. To progress to the next webpage, I want to ensure that at least 2 sections are completely filled in.
I attempted the following approach:
tabel11: new FormGroup({
tabel11A: this.tabel11A,
tabel11B: this.tabel11B,
tabel11C: this.tabel11C,
tabel11D: this.tabel11D,
tabel11E: this.tabel11E
})
if(this.inputTabelForm.get('tabel9').valid){
i+= 1;
}
if(this.inputTabelForm.get('tabel10').valid){
i+= 1;
}
if(this.inputTabelForm.get('tabel11').valid){
i+= 1;
}
if(i >= 2){
return true;
}
It appears that even when all fields are left empty (NULL), they are still considered valid, complicating matters for me. If anyone knows the correct solution to this issue, I would greatly appreciate your guidance!