28,391
社区成员
发帖
与我相关
我的任务
分享
function CheckForm()
{
if(document.getElementById("key").value <> 9)
{
alert("请输入该次考试的9位数考试号!");
document.form.key.focus();
return false;
}
}
<script language="JavaScript">
<!--
function checkdata(){
if( form.key.value.length!=9 ) {
alert("请输入该次考试的9位数考试号")
return false;
}
return true;
}
</script>
<form method="POST" action="cx2006_0901.asp" name="form" onSubmit="return checkdata()">
<table border="0" cellspacing="0" cellpadding="0" width="594" align="center" height="48" bordercolor="#7C96B8" bordercolordark="#FFFFFF">
<tr>
<td width="600" height="20">模拟考试成绩
<select name="biao">
<option selected>考试号 </option>
</select> <input name="key" type="text" size="20" /> <input type="submit" value="确定" name="B12">
<input type="reset" value="重填" name="B22">
【如:02063XXXX】
</td>
</tr>
</table>
</form>
function CheckForm()
{
if(document.form.key.value.length <>9)
{
alert("请选择正确的费用类型!");
document.form.key.focus();
return false;
}
}