Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

validate aadhaar number in javascript

<script> function validateAadhaar(){ 
var regexp = /^[2-9]{1}[0-9]{3}s[0-9]{4}s[0-9]{4}$/; 
var ano = document.getElementById("aadhharno").value; 

if(regexp.test(ano)) { 
console.log("Valid Aadhaar Number"); 
return true; 
}else{ 
console.log("Invalid Aadhaar Number"); 
 return false; 
} } 
</script>
<input type="text" name="aadhhar" id="aadhharno" onfocusout="validateAadhaar()">
 
PREVIOUS NEXT
Tagged: #validate #aadhaar #number #javascript
ADD COMMENT
Topic
Name
4+9 =