Tuesday, July 12, 2011

Mobile Number Validation Javascript

function ValidateMobileNumber()
{
var InputText = document.getElementById('TextBox1').value;
var Expression = /^[0-9]{10}$/
if (InputText.search(Expression) == -1)
{
alert("Invalid Mobile Number. Must Contain Exactly 10 Numbers");
return false;
}
}

No comments:

Post a Comment