skip to Main Content

Javascript – how to prevent special charactors in ion-input .?

special characters are accepting in input field . i am using the field for storing the serial number. serial number is alphanumeric <ion-input [(ngModel)]="serial_number" (ngModelChange)="validation($event)" #serialno id="serialno" class="cac-input"></ion-input> validation(event) { const inputElement = document.getElementById('serialno') as HTMLInputElement; const pattern = /^[a-zA-Z0-9]*$/;…

VIEW QUESTION
Back To Top
Search