Skip to content
Snippets Groups Projects
Verified Commit 9cacd3f4 authored by Lukas Maximilian Kimpel's avatar Lukas Maximilian Kimpel
Browse files

Add name attributes to input fields with [(ngModel)]

parent 24becc89
1 merge request!100Resolve "Remove short ID from room creation/room edit"
Pipeline #13782 passed with stage
in 33 seconds
<form (ngSubmit)="addRoom(longRoomName.value, description.value)"> <form (ngSubmit)="addRoom(longRoomName.value, description.value)">
<div fxLayout="column" fxLayoutAlign="center" fxLayoutGap="10px"> <div fxLayout="column" fxLayoutAlign="center" fxLayoutGap="10px">
<mat-form-field> <mat-form-field>
<input (keypress)="resetEmptyInputs()" matInput #longRoomName class="input-block" type="text" placeholder="Name" <input (keypress)="resetEmptyInputs()" matInput #longRoomName class="input-block" type="text"
maxlength="50" placeholder="Room name" maxlength="50" [(ngModel)]="longName" name="roomName"/>
[(ngModel)]="longName" name="LongName"/>
<mat-hint align="start" *ngIf="!emptyInputs"><strong>Max. letters / signs:</strong></mat-hint> <mat-hint align="start" *ngIf="!emptyInputs"><strong>Max. letters / signs:</strong></mat-hint>
<mat-hint align="end" *ngIf="!emptyInputs">{{longRoomName.value.length}} / 50</mat-hint> <mat-hint align="end" *ngIf="!emptyInputs">{{longRoomName.value.length}} / 50</mat-hint>
<mat-hint align="start" *ngIf="emptyInputs"><strong>Input is required</strong></mat-hint> <mat-hint align="start" *ngIf="emptyInputs"><strong>Input is required</strong></mat-hint>
...@@ -13,8 +12,7 @@ ...@@ -13,8 +12,7 @@
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field>
<textarea (keypress)="resetEmptyInputs()" matInput #description type="text" <textarea (keypress)="resetEmptyInputs()" matInput #description type="text"
placeholder="Description" maxlength="255" placeholder="Description" maxlength="255" name="description"></textarea>
[(ngModel)]="shortName"></textarea>
<mat-hint align="start" *ngIf="!emptyInputs"><strong>Max. letters / signs:</strong></mat-hint> <mat-hint align="start" *ngIf="!emptyInputs"><strong>Max. letters / signs:</strong></mat-hint>
<mat-hint align="end" *ngIf="!emptyInputs">{{description.value.length}} / 255</mat-hint> <mat-hint align="end" *ngIf="!emptyInputs">{{description.value.length}} / 255</mat-hint>
<mat-hint align="start" *ngIf="emptyInputs"><strong>Input is required</strong></mat-hint> <mat-hint align="start" *ngIf="emptyInputs"><strong>Input is required</strong></mat-hint>
......
<div *ngIf="editRoom"> <div *ngIf="editRoom">
<mat-form-field class="input-block"> <mat-form-field class="input-block">
<input [(ngModel)]="editRoom.name" #roomName matInput placeholder="Room name"/> <input [(ngModel)]="editRoom.name" #roomName matInput placeholder="Room name" name="room-name"/>
</mat-form-field> </mat-form-field>
<mat-form-field class="input-block"> <mat-form-field class="input-block">
<textarea [(ngModel)]="editRoom.description" #roomDescription matInput matTextareaAutosize <textarea [(ngModel)]="editRoom.description" #roomDescription matInput matTextareaAutosize
matAutosizeMinRows="2" matAutosizeMaxRows="5" placeholder="Description"></textarea> matAutosizeMinRows="2" matAutosizeMaxRows="5" placeholder="Description" name="description">
</textarea>
</mat-form-field> </mat-form-field>
<div fxLayout="row" fxLayoutAlign="center" fxLayoutGap="10px"> <div fxLayout="row" fxLayoutAlign="center" fxLayoutGap="10px">
<button (click)="dialogRef.close('abort')" mat-button color="primary"> <button (click)="dialogRef.close('abort')" mat-button color="primary">
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment