mobile number validation in javascript

mobile number validation is very important topic in javascript , we are try to say how to use mobile number validation in javascript , i think this is very useful for you thanks

function mobileNoValidation()
var mobile=parseInt(document.getElementById('mobile').value );

//var reg = /^([0-9]{10,10})$/;
var reg = /^\d{10}$/;

if(reg.test(mobile) == false) {

alert('Please Enter Valid mobile number');  document.getElementById('mobile').focus();
return false;
<form action='#'>
<input type="text" name="mobileNo" id="mobile" value="pease enter mobile no " maxlength="10" onClick="(this.value='')" onkeypress="return IsNumber(event , this);"  />

<input  type="submit" value="Submit"  onclick=" return  mobileNoValidation();" maxlength="12"  />



  1. thanks alot. it really helps me out.. god bless u.. thanx a ton


Post a Comment

If you Satisfied , Please Leave a comment

Popular posts from this blog

Call PHP Function In JavaScript Using Ajax

simple costume function in PHP for Add Two Values

check uncheck all check box using javascript and jquery