Kindly suggest Javascript code for Alpha-Numeric Validation of a number ?
- Saraswati Mohanty
- Query: 22 / Answer: 25
- Rojalin Patra
- Query: 22 / Answer: 25
---------------------Javascript Code ----------------------------------------------
<script type="text/javascript">
function alphanumeric()
{
var letterNumber = /^[0-9a-zA-Z]+$/;
var numm=document.getElementById('res_name').value;
if((numm.match(letterNumber)))
{
document.getElementById('err1').innerHTML="";
return true;
}
else
{
document.getElementById('res_name').focus();
document.getElementById('err1').innerHTML="Only Enter Alpha Numeric Values";
return false;
}
}
</script>
-----------------------------------------------------------------------------------------------------------------
----------------------------------HTML Code-----------------------------------------------------------------
<input name="res_name" id="res_name" type="text" class="form-control" style="width:500px;" maxlength="40" placeholder="Enter Name..." onkeyup="alphanumeric();" onblur="alphanumeric();"/>
-
- Information
-
About Forum
This educational forum is produly developed by betaQsolutions-A leading software company in Odisha. This forum is developed to discuss the educational topics only betweeen the Students, teachers, Parents & Experts. Topic related to Career, Syllabus, Subjects, Questions, Exams etc are allowed to discuss here.
-
Statistics
Total topics 43 • Total Query 1115 • Total members 247 • Total Answered 1286