IMPORTANT!
This forum is now archived. Click here for the New Support Forum
Each letter should be automatically converted to uppercase.
Quote from Ingo on April 5, 2018, 4:50 pmHi,
I have the following input in my form.
<mat-form-field [floatLabel]="floatLabels" fxFlex> <mat-label>{{'countries.CountryFlag' | translate}}</mat-label> <input matInput formControlName="countryFlag" [readonly]="!isEditMode" autofocus type="text" [textMask]="{mask: lkzMask}" /> <mat-error *ngIf="countryFlag.hasError('required')">{{'countries.errors.CountryFlagRequired' | translate}}</mat-error> </mat-form-field>I'd like to automatically convert characters to uppercase as you type. How can I solve this problem?
Hi,
I have the following input in my form.
<mat-form-field [floatLabel]="floatLabels" fxFlex> <mat-label>{{'countries.CountryFlag' | translate}}</mat-label> <input matInput formControlName="countryFlag" [readonly]="!isEditMode" autofocus type="text" [textMask]="{mask: lkzMask}" /> <mat-error *ngIf="countryFlag.hasError('required')">{{'countries.errors.CountryFlagRequired' | translate}}</mat-error> </mat-form-field>
I'd like to automatically convert characters to uppercase as you type. How can I solve this problem?
Quote from Al Ve on April 6, 2018, 6:58 amThere are different possibilities, either you use CSS, either Bootstrap, either a directive/pipe to transform you text depending on the use case.
There are many examples to find on Google/Stackoverflow/Medium for what you want to achieve.
But the thing would be to transform the text in uppercase server side if you want it to be saved in uppercase. A client can always change settings.
Very simple if that would fit your needs:
<input type="text" ... other stuff ... onkeyup="javascript:this.value=this.value.toUpperCase()"></input>
<input type="text" style="text-transform: uppercase"></input>
There are different possibilities, either you use CSS, either Bootstrap, either a directive/pipe to transform you text depending on the use case.
There are many examples to find on Google/Stackoverflow/Medium for what you want to achieve.
But the thing would be to transform the text in uppercase server side if you want it to be saved in uppercase. A client can always change settings.
Very simple if that would fit your needs:
<input type="text" ... other stuff ... onkeyup="javascript:this.value=this.value.toUpperCase()"></input>
<input type="text" style="text-transform: uppercase"></input>
IMPORTANT!
This forum is now archived. Click here for the New Support Forum