Search
 
SCRIPT & CODE EXAMPLE
 

TYPESCRIPT

preventing letters from being placed in an input ts

  validateNumber(event) {
    const keyCode = event.keyCode;

    const excludedKeys = [8, 37, 39, 46];

    if (!((keyCode >= 48 && keyCode <= 57) ||
      (keyCode >= 96 && keyCode <= 105) ||
      (excludedKeys.includes(keyCode)))) {
      event.preventDefault();
    }
  }
Comment

preventing letters from being placed in an input ts

<input type="password" placeholder="Enter Mobile no" formControlName="mobile_no" (keydown)="validateNumber($event)">
Comment

PREVIOUS NEXT
Code Example
Typescript :: react native multi select 
Typescript :: java check if element exists in array 
Typescript :: merge to datasets in r 
Typescript :: View and navigate your assignments (teacher) code for asp.net 
Typescript :: how to check if a value exists in unorderedmaps 
Typescript :: java 8 collect multiple lists into single list 
Typescript :: declare array typescript 
Typescript :: ts new example 
Typescript :: angular start date end date validation 
Typescript :: ract import image 
Typescript :: print all alphabets from a to z in java 
Typescript :: Scripts cannot be executed on this system. 
Typescript :: stackoverflow ngbdate angular 
Typescript :: python get elements from list of dictionaries 
Typescript :: show all value_counts pandas 
Typescript :: flutter constructor default value 
Typescript :: conditional type typescript 
Typescript :: get number of digits in an integer python without converting to string 
Typescript :: type definition method typescript 
Typescript :: connect redis typescript usage 
Typescript :: aws s3 list objects by size 
Typescript :: how to take union of two lists in python 
Typescript :: how to permit only a few values in dbms 
Typescript :: stipe elements angular.js 
Typescript :: Route.component does not have any construct or call signatures - React Router with TypeScript 
Typescript :: combine results from two columns in ms sql 
Typescript :: .htaccess Forcing scripts to display as source code 
Typescript :: typescript ! 
Typescript :: convert f# 
Typescript :: react native websocket disconnect handler 
ADD CONTENT
Topic
Content
Source link
Name
7+2 =