Mobile NO Validation in JavaScript

Debendra256
Posted by Debendra256 under JavaScript category on | Points: 40 | Views : 421
<script type="text/javascript">  
function validate() {
var a = document.getElementById("<%=txtphone.ClientID %>").value;
if (a == "Ex: 08018070345") {
alert("Mobile no Should Not be Blank");
document.getElementById("<%=txtphone.ClientID %>").focus();
return false;
}
if (isNaN(a)) {
alert("Enter the valid Mobile Number(Like : 08018070777)");
document.getElementById("<%=txtphone.ClientID %>").focus();
return false;
}
if (a.length < 11) {
alert(" Your Mobile Number must 11 Integers(Like :08018070777)");
document.getElementById("<%=txtphone.ClientID %>").focus();
return false;
}
}
</script>

Comments or Responses

Login to post response