Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

input should reject non-alphabetical input reacj js

onChangeAlphaNumericInput(e) {
  const value = e.target.value;
  const regex = /^[0-9a-zA-Z(-)]+$/; //this will admit letters, numbers and dashes
  if (value.match(regex) || value === "") {
    this.setState({ inputValue: value });
  }
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: click outside button angular 
Javascript :: how to render req.session.name to ejs 
Javascript :: convert todays date to json datetime 
Javascript :: Get even numbers with VanillaJS 
Javascript :: joining two array 
Javascript :: react native debug server host & port for device 
Javascript :: what is renderer in three.js 
Javascript :: format JSON in VS 
Javascript :: re-resizable react example 
Javascript :: es6 spread operator 
Javascript :: Star Wars Celebration 
Javascript :: how to use session with cookie js nodejs 
Javascript :: removes all item occurrences in array 
Javascript :: backbone.js validation 
Javascript :: how to create element with class in javascript 
Javascript :: _.extend() Explanation 
Javascript :: Backbone Initialize vs Render 
Javascript :: react native uncaught error main has not been registered stackoverflow 
Javascript :: telerik grid destroy table 
Javascript :: joi custom validation read data for all fields 
Javascript :: regex remove whitespace 
Javascript :: javascript create li element and append to ul 
Javascript :: VM1658:1 Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0 
Javascript :: array inside array javascript 
Javascript :: form submit with ajax 
Javascript :: javascript$.4908BEAMpacidE 
Javascript :: how to convert javascript to typescript angular 
Javascript :: how to compile javascript class to function 
Javascript :: Plumsail change the size of the dialog window 
Javascript :: autonumeric stimulus 
ADD CONTENT
Topic
Content
Source link
Name
5+2 =