<ion-input> force uppercase


#1

How to force the input text in ion-input field in uppercase?

Thanks


#2

Maybe bind an onchange() event to the input and ngModel. Then just do

onchange(){
this.ngmodel.toLocalUpperCase();
}

Didn’t try it, just a quick idea.


#3

Thanks i resolve with this code:

<ion-input [(ngModel)]="plate" (ionChange)="setFilteredItems(plate)" type="text" value="{{img}}" placeholder="Inserisci la Targa"></ion-input>

  setFilteredItems(plate) {
    this.plate = plate.toUpperCase();
  }