<ion-input> force uppercase

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

Thanks

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.

1 Like

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();
  }
2 Likes

This might be helpful.