kuken
注册会员

UID 73019
精华
0
积分 51
帖子 25
金钱 51 喜悦币
威望 0
人脉 0
阅读权限 20
注册 2006-5-9 来自 河北省邯郸市
状态 离线
|
大家帮我看看为什么JS不能用呢?
<table width="100%" border="0" align="center" cellpadding="4" cellspacing="0" class="infolink" >
<form name="add" action="aa.php" method="post">
<tr>
<td width="32%" height="0" align="right" class="text">现在的水平 :</td>
<td width="68%" height="25" class="text"><input name="clevel" type="text" id="clevel" class="finput" />
<span class="STYLE1">*</span<div id="nowsp_info"></div></td>
</tr>
<tr>
<td height="30" colspan="2" align="center"><input type="submit" name="rok" value="Continue" id="rok" class="imageinput" onClick="check_form();"/></td>
</tr></form>
</table>
<script>
function check_form(){
var fromname;
fromname = document.add;
if(fromname.clevel.value==""){
document.getElementById('nowsp_info').innerHTML="This for fill an item necessarily。";
document.getElementById('nowsp_info').className="ErrorMsg";
return false;
}
document.add.submit();
}
</script>
为什么他直接就跑到aa.php中啦,, 我想的是如果input为空的话不跑到aa.php怎么做  :Q
[ 本帖最后由 kuken 于 2007-5-18 07:21 AM 编辑 ]
|
|