<input class="text" name="Serial_Num" type="text" id="SrNo" size="2" maxlength="2" onkeypress="return digitKeyOnly(event)" /> Run code snippet