Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR 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;
}
 
PREVIOUS NEXT
Tagged: #regex #check #numbers #js
ADD COMMENT
Topic
Name
2+4 =