VBSCRIPT

来源:百度知道 编辑:UC知道 时间:2024/05/05 22:12:09
<script language="vbscript">
function checkform()
dim msg
if len(trim(theForm.title.value))=0 then
msg=MsgBox("error",48,"err")
msg.show()
theForm.title.focus()
Exit Function
else
theForm.submit
end if
end function
</script>
<form id="theForm" name="theForm" method="post" action="message_main.asp" >
<input type="submit" name="Submit" value="提交" onclick=checkForm()>
</form>
虽然是有个对话框弹出,但是它还是会提交,我想要的是弹出对话框确定后,不提交!应该怎么弄!
问题补充:coolapp
你说的我试了,它提示是:类型不匹配:'return'

麻烦回答的高手们,确定无错误在发~!~
我试了几遍了,JS就没有问题
提问者:ca2ju3 - 童生 一级
• 问题补充:可以对您的提问补充细节,以得到更准确的答案;
• 提高悬赏:提高悬赏分,以提高问题的关注度;
• 发起投票:不知道哪个回答最好时,可让网友投票来选出最佳答案;
• 无满意答案:没有满意的回答,还可直接结束提问,关闭问题。
答复共 2 条
好高深啊
回答者:wpphxu - 见习魔法师 二

<script language="vbscript">
function checkform()
if len(trim(theForm.title.value))=0 then
msg=MsgBox("error",48,"err")
theForm.title.focus()
Exit Function
end if
theForm.submit()
end function
</script>
<form id="theForm" name="theForm" method="post" action="message_main.asp">
<input id="title" name="title" type="text">
<input type="button" value="提交" onclick="checkform()">
</form>