Live Chat Icon For mobile
Live Chat Icon

How can i form a regular expression which identifies a valid whole number without decimal places?

Platform: ASP.NET| Category: Client Side Scripting

The regular expression used to identify only the numbers is var regexp = /\D|\./.

function IdentifyNumbers() 
	var Number = document.getElementById('NumericValue').value; 
	var regexp = /\D|\./ ; 
		alert('Only enter numbers and no decimal point\nInvalid input: '+Number.match(regexp));
		alert('Valid Input');

Share with

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.