一个表格不能为空的问题
<html>
......
<script language= "javascript ">
function chackall()
{
if(document.scan_small.sm1.value.length==0)
{
alert( "不能为空! ");
ax1.sm1.focus();
return false;
}
return true;
}
</script>
......
<form action= "x.asp " method= "post " name= "ax1 " onSubmit= "return chackall(this) ">
<input type= "text " size= "50 " name= "sm1 ">
<input type= "text " size= "50 " name= "sm2 ">
<input type= "text " size= "50 " name= "sm3 ">
<input type= "text " size= "50 " name= "sm4 ">
</form>
......
</html>
====================================
上面只能禁止 "sm1 "不为空,有没有一种方法能使1、2、3、4都不能为空。当然,通过多条if可以实现,但有没有一种更简短的方法。请大侠指点。
------解决方案--------------------关注