
I have box where i can only put the number except + . Like +91

<script>
function checkMobileNumber(number){
if(/[^\d ]/.test(number)){
alert('It should contain numbers [0-9] only!');
document.getElementById("st").value="";
return false;
}
if(number.substring(0,2)!="91"){
alert("Number should begin with 91");
document.getElementById("st").value="";
return false;
}
if (number.length>12){
alert("Invalid Mobile Number!It cannot exceeds the limit of 12 digits. ");
document.getElementById("st").value="";
return false;
}
return true;
}
</script>
Enter Mobile Number:   <input type="text" id="st" onkeyup="checkMobileNumber(this.value);">
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.