想要在表单提交时严正表但中各个域的值是否为空.如为空则提示出错信息.并将光标指向form中第一个为空的域..
<form action="" name=form onsubmit="return check(this)">
<script language=vbscript>
function check(obj)
end function
</script>
...全文
468打赏收藏
用vbscript如何写下面函数最简洁高效..
想要在表单提交时严正表但中各个域的值是否为空.如为空则提示出错信息.并将光标指向form中第一个为空的域.. function check(obj) end function
高效简洁我不知道怎么写?
msg="error"
if document.form.text1.value="" then
msgbox msg
document.form.text1.focus
elseif document.form.text2.value="" then
msgbox msg
document.form.text2.focus
elseif document.form.text3.value="" then
msgbox msg
document.form.text3.focus
end if