Hi all,
I have to do numbers validation using javascript, In that i have few douts about javascript, My application flow should like this,
i have one textbox which i validate to allow only digits , in digits i have allow up to 10,11 digits only but in my javascript code which cannot allow characters which is allowed only numbers thats i need But its cannot allow upto 10,11 digits, please find out the below code,
javascript:
<script type="text/javascript">
function validate()
{
var Tel = document.getElementById("<%=TextBox1.ClientID%>")
if(Tel.value == "")
{
alert("Enter Your Telephone No");
Tel.focus();
return false;
}
var emailPat = /d[10,11]+$/;
var emailid=Tel.value;
var matchArray = emailid.match(emailPat);
if (matchArray == null)
{
alert("It allows only digits (10-11 digits)");
Tel.focus();
return false;
}
}
</script>