在(VBS)网页编程中:action  和 onsubmit() 或oncheck()事件可以同时用吗? 怎样才能做到根据(onsubmit)事件触发(action)命令.我的程序怎么是同时响应的阿,请各位大虾诊断一下,谢谢了,各位大虾!!
<html>
<head>
<title>阳光工程</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="VI60_defaultClientScript" content="VBScript">
<script language ="VBScript">
Sub Check1()
    if frm1.T1.value<>empty and frm1.t2.value<>empty then
       hh=msgbox("你好:" & len(trim(frm1.t1)),48,"正确")
      else
       hh=msgbox("你好:请输入完整的数据......",48,"错误提示")
       focusto(0)
       Exit sub
    end if
End subSub focusto(x)
    document.frm1.elements(x).focus()
End sub
</script>
</head>
<body bgcolor="#0099ff" text="#ffffff">
<p>
 </p>
<form name=frm1  action="index.asp"  method=post >
<p></p>
<table width="27%" cellspacing="0" id="table1" align="right" height="47" cellpadding="0" border=0>
<tr>
<td width="747" align="right">用户姓名:</td>
<td width="99"><input type="text" name="T1" size="13"></td>
<td width="60" rowspan="2">
<input type="image" tabindex="3" src="button23.jpg" width="54" height="48" onsubmit="check1()"
name="I1" ></td>
</tr>
<tr>
<td width="747" height="22" align="right">用户密码:</td>
<td width="99" valign="top"><input type="password" name="T2" size="13"></td>
</tr>
</table></form>
</body></html>

解决方案 »

  1.   

    是可以的,
    如果VBS不行,可以试试JS
      

  2.   

    这些代码有点问题:
    1、是<form name=frm1 action="index.asp" method=post onsubmit="check1()">
    而不是<input type="image" tabindex="3" src="button23.jpg" width="54" height="48" onsubmit="check1()" 
    name="I1">
    onsubmit="check1()"填写得不是地方2、check1函数返回true时,允许表单frm1提交信息;返回时就禁止提交。而上述代码中check1函数都没赋予返回值。