Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

regex check for numbers only js

var ticket = "11122";
var reg = new RegExp('^[0-9]*$');

if (reg.test(ticket)==false) {
  alert('Only Numeric Ticket ID is allowed.');
  return false;
}
Comment

javascript regex test number only

/^[0-9]*$/.test('abc123') // false
Comment

PREVIOUS NEXT
Code Example
Javascript :: border bootstrap 
Javascript :: react jsx style with calc 
Javascript :: react js input autocomplete off 
Javascript :: set checkbox checked jquery 
Javascript :: YT.Player is not a constructor 
Javascript :: stripe npm 
Javascript :: react map 
Javascript :: console.log color 
Javascript :: angular httpheaders example 
Javascript :: why my bootstrap classes is not working on onclick event in react 
Javascript :: convert arguments to array javascript 
Javascript :: create react app in existing folder 
Javascript :: angular how to get previous state 
Javascript :: javascript remove dom element 
Javascript :: how to get text which is in input td using jquery 
Javascript :: how to swap two elements in an array js 
Javascript :: javascript json upload 
Javascript :: how to get data from user in javascript 
Javascript :: jquery ajax type json 
Javascript :: js date year 
Javascript :: data-widget="pushmenu" collable automatically 
Javascript :: datetimepicker set value 
Javascript :: jquery select element based on for attribute 
Javascript :: js console log input value 
Javascript :: angular cli add sslkey certificate 
Javascript :: add a trailing slash javascript url 
Javascript :: how to play music in js 
Javascript :: how to get day from javascript date 
Javascript :: js get the week monday to friday date 
Javascript :: loopback get relationship in before save 
ADD CONTENT
Topic
Content
Source link
Name
6+3 =