sub NumChange(rowid)
theform=eval("document.form1."+rowid)
num=eval("document.form1."+rowid+".value")
if num mod 2 <> 0 then
msgbox("请输入偶数!")
theform.focus
window.event.returnvalue=false
end if
end sub
这样为什么无法获的焦点
...全文
623打赏收藏
参数传递无法获的文本焦点
sub NumChange(rowid) theform=eval("document.form1."+rowid) num=eval("document.form1."+rowid+".value") if num mod 2 0 then msgbox("请输入偶数!") theform.focus window.event.returnvalue=false end if end sub 这样为什么无法获的焦点
<script language=vbscript>
sub NumChange(theobj)
num=theobj.value
if num mod 2 <> 0 then
msgbox("请输入偶数!")
theobj.focus
window.event.returnvalue=false
end if
end sub
</script>
<form id=form1 name=form1>
<input id=hehe name==hehe>
<input type=button onclick="VBScript:NumChange(form1.hehe)">
</form>