<html><head>
<script language="javascript">
function only(which, numberOfDigit,min,max) {
which.value = which.value.replace(/\D/g,'');
if( (which.value.length != numberOfDigit) || (parseInt(which.value)<min) || (parseInt(which.value)>max) ) {
which.focus();
}
}
</script>
</head><body>
<form action="http://www.google.com" method="get" >
Month : <input type="text" maxlength="2" onKeyUp="only(this,2,1,12);" onBlur="only(this,2,1,12);" /> Year : <input type="text" maxlength="4" onKeyUp="only(this,4,2000,2010);" onBlur="only(this,4,2000,2010);" />
<br />
<input type="submit" value="submit" />
</form>
</body></html>
|