<html>
<head>
<script language=vbscript>
Sub CheckValue()
If document.all.kind1.value="3" and document.all.user_bm.value="" then
alert("???入被曝光?位!")
window.event.returnvalue=false
return
End If
End Sub
</script>
</head>
<body>
<input type="text" id="kind1" value="3" >
<input type="text" id="user_bm" value="check" >
<input type="button" value="check" onclick="CheckValue()">
</body></html>没错,有错的地方可能是你then不小心按回车换行了。
<head>
<script language=vbscript>
Sub CheckValue()
If document.all.kind1.value="3" and document.all.user_bm.value="" then
alert("???入被曝光?位!")
window.event.returnvalue=false
return
End If
End Sub
</script>
</head>
<body>
<input type="text" id="kind1" value="3" >
<input type="text" id="user_bm" value="check" >
<input type="button" value="check" onclick="CheckValue()">
</body></html>没错,有错的地方可能是你then不小心按回车换行了。
alert("请您输入被曝光单位!") ''你到底是写vbscript 还是javascript??
系统吧?呵呵,你写alert("???入被曝光?位!")这句时出现了乱码。
Sub CheckValue()
If document.all.kind1.value="3" and document.all.user_bm.value="" then
alert("请您输入被曝光单位!")
window.event.returnvalue=false
return
End If
End Sub
</script>
我用的是vbscript ,因为我单个判断是可以的, 两个条件连起来就不行了, 不是报错,就是这两个条件符合的时候他不跳出警告语