|
主题: 谁帮我看看,为什么不能提交 用 submit() 急,在线等
|
 xxj19820224
职务:普通成员
等级:1
金币:0.0
发贴:31
注册:2003/10/25 13:52:20
|
#12004/3/20 14:10:49
<script language="javascript" type="text/javascript"> <!-- function check_user() { if (document.form1.user_name.value=="") {alert("对不起,您没有填写用户名!"); return false;} else if (document.form1.user_pwd.value=="") {alert ("对不起,您没有填写密码!"); return false;} else document.form1.submit(); } //--> </script>
<table width="200" align="center" border="1" cellpadding="0" cellspacing="0"> <form action="../temp/login_check.asp" method="post" name="form1" id="form1"> <tr><td align="center" colspan="2">登陆窗口</td></tr> <tr><td>用户名:</td><td><input type="text" name="user_name" id="user_name" size="16"></td></tr> <tr><td>密 码:</td><td><input type="text" name="user_pwd" id="user_pwd" size="16"></td></tr> <tr><td colspan="2" align="center"><input type="button" name="submit" value="登陆" onClick="check_user()" > <input type="reset" name="reset" value="重置"></td></tr></form> <table>
|
 xxj19820224
职务:普通成员
等级:1
金币:0.0
发贴:31
注册:2003/10/25 13:52:20
|
#22004/3/20 14:15:19
为什么什么总是弹出“对象不支持此属性和方法”,但我查过,form就这么一个submit方法!
|
 elite_5d
职务:普通成员
等级:2
金币:1.0
发贴:330
注册:2003/7/4 12:32:30
|
#32004/3/21 13:12:14
<script language="javascript" type="text/javascript"> <!-- function check_user() { if (document.form1.user_name.value=="") {alert("对不起,您没有填写用户名!"); return false;} else if (document.form1.user_pwd.value=="") {alert ("对不起,您没有填写密码!"); return false;} else return true; } //--> </script>
<table width="200" align="center" border="1" cellpadding="0" cellspacing="0"> <form action="../temp/login_check.asp" method="post" name="form1" onsubmit=retrun check_user(); id="form1"> <tr><td align="center" colspan="2">登陆窗口</td></tr> <tr><td>用户名:</td><td><input type="text" name="user_name" id="user_name" size="16"></td></tr> <tr><td>密 码:</td><td><input type="text" name="user_pwd" id="user_pwd" size="16"></td></tr> <tr><td colspan="2" align="center"><input type="submit" name="submit" value="登陆"> <input type="reset" name="reset" value="重置"></td></tr></form> <table>
|
 凹都凹不摇
职务:普通成员
等级:1
金币:0.0
发贴:50
注册:2004/3/11 17:28:07
|
#42004/3/22 14:39:05
晕。 else document.form1.submit();,你的尖括号{ ...... }上哪儿去了?
|