I have to validate the following scenario: "15AB12" Conditions: (1) First element should be 1 + a single digit+ two alphabets + 2 digits. I need to validate this for a textbox. Here's my code. I don't know where i missed!!!
<label>Username(6):</label>
<input id='username' type='text'>
<p id="p2"></p>
<button id="submit" onclick= "pepe(); return false"">ChecForm</button>
<script>
function pepe(){
if (!($("#username").val().match(/^1\[a-zA-Z0-9]{5}/)))
document.write(" true");
else
document.write("false");
}
</script>