Header Ads

javascipt Numerical only

Use this javascript function to check whether the textbox value is numerical or not

function NumericalOnly() {
var numericalOnly = new RegExp(”^[0-9]*$”)
var textbox = document.getElementById(”TextBox1″).value;
if (!numericalOnly.test(textbox)) {
alert(”Please enter a valid number!”)
}
}

No comments:

Powered by Blogger.