<input type=button name=test onclick="javascript:return myfunc1();"/>
....
<script language=vbscript>
sub test_onClick()
msgbox "how are you "
end sub
</script>
能不能一個按鍵執行兩套代碼?多謝!
应该写成下面这种形式
[QUOTE]<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<body>
<SCRIPT language="javascript">
var errorstr;
function check()
{
errorstr = ""
checkname();
checkpass();
if (errorstr!="")
{
alert(errorstr);
return false;
}
return true;
}
function checkname()
{
if (!document.form1.username.value)
{
errorstr=errorstr+'请输入用户名称\n';
document.form1.username.focus();
}
}
function checkpass()
{
if (!document.form1.userpass.value)
{
errorstr=errorstr+'请输入用户密码\n';
document.form1.userpass.focus();
}
}
</script>
<form name="form1" id="form1" method="post" action="1.html" onsubmit="return check();">
<input name="username" type="text">
<p>
<input name="userpass" type="text">
</p>
<p>
<input type="submit" name="Submit" value="提交">
</p>
</form>
</body>
</html>[/QUOTE]