Skip to content

Commit

Permalink
Visit submit button disabled if visit not valid, specialty edit maxle…
Browse files Browse the repository at this point in the history
…ngth corrected (80) as well as pattern
  • Loading branch information
Holger-Mayer committed Aug 26, 2024
1 parent 7ef5ec6 commit 4dcbe62
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ <h2>Edit Specialty</h2>
<div class="form-group has-feedback" [class.has-success]="name.dirty && name.valid" [class.has-error]="name.dirty && !name.valid">
<label class="col-sm-1 control-label">Name</label>
<div class="col-sm-6">
<input id="name" name="name" class="form-control" type="text" minlength="1" maxlength="30" pattern="^[A-Za-z0-9].{0,29}$" required [(ngModel)]="specialty.name" #name="ngModel"/>
<input id="name" name="name" class="form-control" type="text" minlength="1" maxlength="80" pattern="^[A-Za-z0-9].{0,79}$" required [(ngModel)]="specialty.name" #name="ngModel"/>
<span class="glyphicon form-control-feedback" [class.glyphicon-ok]="name.valid" [class.glyphicon-remove]="!name.valid" aria-hidden="true"></span>
<span class="help-block" *ngIf="name.dirty && name.hasError('maxlength')">Name may be only 80 characters long</span>
<span class="help-block" *ngIf="name.dirty && name.hasError('minlength')">Name must be at least 1 characters long</span>
Expand Down
2 changes: 1 addition & 1 deletion src/app/visits/visit-add/visit-add.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ <h2>New Visit</h2>
<input type="hidden" name="id" id="id" [(ngModel)]="visit.id"/>
<input type="hidden" name="pet" id="pet" [(ngModel)]="visit.pet"/>
<button class="btn btn-default" type="button" (click)="gotoOwnerDetail()">Back</button>
<button class="btn btn-default" type="submit">Add Visit</button>
<button class="btn btn-default" type="submit" [disabled]="!visitForm.valid">Add Visit</button>
</div>
</div>
</form>
Expand Down

0 comments on commit 4dcbe62

Please sign in to comment.