 |
|
Code
<head>
<script type="text/javascript">
function check(a, b, e)
{
if (window.event){charCode = window.event.keyCode;}else{if (e) charCode = e.which;}
if (( (charCode>95) && (charCode<106) ) || ( (charCode>47) && (charCode<58) ) || ( (charCode>7) && (charCode<10) ) || ( (charCode>12) && (charCode<14) ))
{
// between 0-9
var objForm = document.forms["register"];
var letters = a.value.length;
if (letters < 1)
{
a.focus();
}else{
objForm[b].focus();
}
}else{
alert("กรุณากรอกเฉพาะตัวเลขเท่านั้นค่ะ");
a.value="";
}
}
</script>
</head>
<body>
<table width="600" align="center" cellpadding="0" cellspacing="0">
<form name="register" method="post">
<tr>
<td width="100">เบอร์โทรศัพท์</td>
<td width="10">08</td>
<td width="10" class="fillText" valign="middle"><input class="fillText" type="text" maxlength="1" name="tele_1" id="tele_1" onKeyUp="check(this, 'tele_2', event);" style="text-align:center;width:10px; height:20px;padding:0 0 0 0; margin:0; border:1px; background-color:#999999;"></td>
<td width="10" class="fillText" valign="middle"><input class="fillText" type="text" maxlength="1" name="tele_2" id="tele_2" onKeyUp="check(this, 'tele_3', event);" style="text-align:center;width:10px; height:20px;padding:0 0 0 0; margin:0; border:1px; background-color:#999999;"></td>
<td width="10" class="fillText" valign="middle"><input class="fillText" type="text" maxlength="1" name="tele_3" id="tele_3" onKeyUp="check(this, 'tele_4', event);" style="text-align:center;width:10px; height:20px;padding:0 0 0 0; margin:0; border:1px; background-color:#999999;"></td>
<td width="10" class="fillText" valign="middle"><input class="fillText" type="text" maxlength="1" name="tele_4" id="tele_4" onKeyUp="check(this, 'tele_5', event);" style="text-align:center;width:10px; height:20px;padding:0 0 0 0; margin:0; border:1px; background-color:#999999;"></td>
<td width="10" class="fillText" valign="middle"><input class="fillText" type="text" maxlength="1" name="tele_5" id="tele_5" onKeyUp="check(this, 'tele_6', event);" style="text-align:center;width:10px; height:20px;padding:0 0 0 0; margin:0; border:1px; background-color:#999999;"></td>
<td width="10" class="fillText" valign="middle"><input class="fillText" type="text" maxlength="1" name="tele_6" id="tele_6" onKeyUp="check(this, 'tele_7', event);" style="text-align:center;width:10px; height:20px;padding:0 0 0 0; margin:0; border:1px; background-color:#999999;"></td>
<td width="10" class="fillText" valign="middle"><input class="fillText" type="text" maxlength="1" name="tele_7" id="tele_7" onKeyUp="check(this, 'tele_8', event);" style="text-align:center;width:10px; height:20px;padding:0 0 0 0; margin:0; border:1px; background-color:#999999;"></td>
<td width="10" class="fillText" valign="middle"><input class="fillText" type="text" maxlength="1" name="tele_8" id="tele_8" onKeyUp="check(this, 'tele_8', event);" style="text-align:center;width:10px; height:20px;padding:0 0 0 0; margin:0; border:1px; background-color:#999999;"></td>
</tr>
</table>
</form>
</body>
Tag : - - - -
|
|
 |
 |
 |
 |
Date :
2010-07-14 15:11:00 |
By :
gutonteen |
View :
2149 |
Reply :
1 |
|
 |
 |
 |
 |
|
|
|
 |