required fields in project

This commit is contained in:
annampak 2017-11-07 12:46:24 +02:00
parent da6c98cacd
commit 4f4d7087f3
1 changed files with 6 additions and 7 deletions

View File

@ -80,11 +80,10 @@
</button> </button>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<form #newProjectForm="ngForm" (ngSubmit)="SaveProject()"> <form #newProjectForm="ngForm" (ngSubmit)="SaveProject()" novalidate>
<div class="form-group">
<label for="label-name" class="form-control-label">Label:</label> <label for="label-name" class="form-control-label">Label:</label>
<input type="text" class="form-control" id="label-name" [(ngModel)]= "project.label" name = "label"> <input type="text" class="form-control" id="label-name" [(ngModel)]= "project.label" name = "label" required>
</div>
<div class="form-group"> <div class="form-group">
<label for="abbreviation-text" class="form-control-label">Abbreviation:</label> <label for="abbreviation-text" class="form-control-label">Abbreviation:</label>
<input class="form-control" id="abbreviation-text" [(ngModel)]= "project.abbreviation" name = "abbreviation"> <input class="form-control" id="abbreviation-text" [(ngModel)]= "project.abbreviation" name = "abbreviation">
@ -99,11 +98,11 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="start-date" class="form-control-label">Start Date:</label> <label for="start-date" class="form-control-label">Start Date:</label>
<input class="form-control" type='date' class="form-control" [(ngModel)]= "project.startdate" id='start-date' name = "startdate"/> <input class="form-control" type='date' class="form-control" [(ngModel)]= "project.startdate" id='start-date' name = "startdate" required/>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="end-date" class="form-control-label">End Date:</label> <label for="end-date" class="form-control-label">End Date:</label>
<input class="form-control" type='date' class="form-control" [(ngModel)]= "project.enddate" id='end-date' name = "enddate"/> <input class="form-control" type='date' class="form-control" [(ngModel)]= "project.enddate" id='end-date' name = "enddate" required/>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="status-name" class="col-form-label">Status:</label> <label for="status-name" class="col-form-label">Status:</label>
@ -119,7 +118,7 @@
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button> <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-primary" (click)="SaveProject();">Save project</button> <button type="submit" class="btn btn-primary" [disabled]="!newProjectForm.form.valid" (click)="SaveProject();">Save project</button>
</div> </div>
</div> </div>
</div> </div>