呵呵,上面的对,不过VBSCRIPT也可以
<script language=vbscript>
function checkform()
if (form1.txt1.value=="") then
msg("不能为空")
end if
</script> 作者:
yangchilang 时间: 2006-3-10 15:24
<script>
function checkform()
dim errflag, msg
errflag = True
If len(trim(theForm.text1.value))= 0 then
msg = "不能为空"
MsgBox msg, 64, "警告!"
focusto(0)
errflag = false
Exit Function
End if
checkform = errflag
theForm.Submit
End Function
sub focusto(x)
document.theForm.elements(x).focus()
end sub
</script>