Hello,
I am working on a Java-script, for which I need regular expression to check whether the entered text in text-box should be combination of alphabets and numeric value.
I tried NaN function of java-script but string should be of minimum-size & maximum-size of length 4 and start with Alphabet as first element and remaining 3 element should be numbers.
For example : Regular expression for A123, D456, a564 and not for ( AS23, 1234, HJI1 )
Please suggest me !!!
Code Here:
<script type="text/javascript">
var textcode = document.form1.code.value;
function fourdigitcheck(){
var textcode = document.form1.code.value;
alert("textcode:"+textcode);
var vmatch = /^[a-zA-Z]\d{3}$/.test("textcode");
alert("match:"+vmatch);
}
</script>
<form name="form1">
Enter your Number <input type="text" name="code" id="code" onblur="fourdigitcheck()" />
</form>