Skip to content
Snippets Groups Projects
Commit 97527dd1 authored by Erik Moravec's avatar Erik Moravec
Browse files

fix: fixed disapearing game schedule form

parent 8e59ac9d
No related branches found
No related tags found
No related merge requests found
<div class="container m-0"> <div class="container m-0">
<div [hidden]="submitted"> <div>
<h1 class="fw-bold ms-2 mt-2 fs-2">New Game Form</h1> <h1 class="fw-bold ms-2 mt-2 fs-2">New Game Form</h1>
<form #gameForm="ngForm" (ngSubmit)="onSubmit()" class="ms-3"> <form #gameForm="ngForm" (ngSubmit)="onSubmit()" class="ms-3">
<div class="form-group"> <div class="form-group">
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
id="gameDateTime" id="gameDateTime"
name="gameDateTime" required name="gameDateTime" required
type="text"> type="text">
<div [hidden]="gameDateTime.valid || gameDateTime.pristine" <div [hidden]="gameDateTime.valid || gameDateTime.pristine || submitted"
class="alert alert-danger"> class="alert alert-danger">
Name is required Name is required
</div> </div>
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
required> required>
<option *ngFor="let team of teams" [ngValue]="team">{{team.name}}</option> <option *ngFor="let team of teams" [ngValue]="team">{{team.name}}</option>
</select> </select>
<div [hidden]="homeTeam.valid || homeTeam.pristine" class="alert alert-danger"> <div [hidden]="homeTeam.valid || homeTeam.pristine || submitted" class="alert alert-danger">
Home Team is required Home Team is required
</div> </div>
</div> </div>
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
required> required>
<option *ngFor="let team of teams" [ngValue]="team">{{team.name}}</option> <option *ngFor="let team of teams" [ngValue]="team">{{team.name}}</option>
</select> </select>
<div [hidden]="awayTeam.valid || awayTeam.pristine" class="alert alert-danger"> <div [hidden]="awayTeam.valid || awayTeam.pristine || submitted" class="alert alert-danger">
Away Team is required Away Team is required
</div> </div>
</div> </div>
......
...@@ -39,6 +39,7 @@ export class CreateGameFormComponent implements OnInit { ...@@ -39,6 +39,7 @@ export class CreateGameFormComponent implements OnInit {
onSubmit(): void { onSubmit(): void {
this.submitted = true; this.submitted = true;
this.confirmSubmission(); this.confirmSubmission();
this.resetForm();
} }
resetForm(): void { resetForm(): void {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment