Skip to content
This repository has been archived by the owner on Dec 31, 2022. It is now read-only.

Commit

Permalink
Adding max length to form text inputs. Fixes #67.
Browse files Browse the repository at this point in the history
  • Loading branch information
dessalines committed Sep 11, 2018
1 parent bb32aba commit 3ede6e7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions ui/src/app/components/candidate/candidate.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@
</div>
</div>
</div>
<form *ngIf="this.candidate.editing" (ngSubmit)="updateCandidate()">
<form *ngIf="this.candidate.editing" (ngSubmit)="updateCandidate()" class="needs-validation" novalidate #candidateForm="ngForm">
<div class="form-group">
<div class="input-group">
<input type="text" class="form-control" autofocus [(ngModel)]="candidate.title" name="candidate_title" placeholder="Enter your option name...">
<input id="candidate_title" required type="text" class="form-control" autofocus [(ngModel)]="candidate.title" name="candidate_title" maxlength="255" placeholder="Enter your option name..." #candidate_title="ngModel">
<span class="input-group-append">
<button class="btn btn-primary" type="submit" role="button">Save</button>
<button class="btn btn-primary" type="submit" role="button" [disabled]="!candidateForm.form.valid">Save</button>
</span>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion ui/src/app/components/poll/poll.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ <h2>Edit Poll</h2>
<label class="col-md-2 col-form-label">Title</label>
<div class="col-md-10">
<input type="text" class="form-control" [(ngModel)]="poll.title" name="poll_title" placeholder="Enter your poll name..."
autofocus>
autofocus maxlength="255">
</div>
</div>
<div class="form-check">
Expand Down
6 changes: 3 additions & 3 deletions ui/src/app/components/question/question.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ <h4>Details</h4>
</div>
</div>
</div>
<form *ngIf="this.question.editing" (ngSubmit)="updateQuestion()">
<form *ngIf="this.question.editing" (ngSubmit)="updateQuestion()" #questionForm="ngForm">
<h4>Edit Question</h4>
<div class="form-group row">
<label class="col-md-2 col-form-label">Title</label>
<div class="col-md-10">
<input type="text" class="form-control" autofocus [(ngModel)]="question.title" name="question_title" placeholder="Enter your question name...">
<input type="text" class="form-control" autofocus maxlength="255" [(ngModel)]="question.title" name="question_title" placeholder="Enter your question name...">
</div>
</div>
<div class="form-check">
Expand Down Expand Up @@ -86,7 +86,7 @@ <h4>Edit Question</h4>
<input type="text" class="form-control" #dp="bsDatepicker" bsDatepicker [(bsValue)]="expireDate" name="question_expire_time">
</div>
</div>
<button class="btn btn-primary" type="submit" role="button">Save</button>
<button class="btn btn-primary" type="submit" role="button" [disabled]="!questionForm.form.valid">Save</button>
</form>
<div *ngIf="!this.question.editing">
<div *ngFor="let candidate of question.candidates; let i = index">
Expand Down

0 comments on commit 3ede6e7

Please sign in to comment.