100分寻求submit时无此属性和对象的解答
我有下列代码
<script language="VBScript">
function Sure()
msg="模拟手机"&document.form1.mobile.value&"发送消息"&document.form1.message.value&"吗?"
if(msgbox(msg,vbyesno+vbquestion,"确认发送吗?")=vbyes) then
form1.submit()
end if
end function
</script>
<form name="form1">
<input>
<input>
<input name="Button" type="button" id="submit" value="发送" onClick=sure()>
</form>
当点击发送后出现提示框之后,选择Yes后告诉我无此属性或对象 document.form1.submit
我该怎么办?
问题点数:100、回复次数:7Top
1 楼zyhowe(★☆偶然的天空☆★)回复于 2002-08-20 13:32:29 得分 0
<input>
<input>
->
<input type="text" name="mobile">
<input type="text" name="message">Top
2 楼cshadow(heli)回复于 2002-08-20 13:32:42 得分 0
<FORM language=javascript name=form1 onsubmit="Sure()" method=post>Top
3 楼MeXP(秦汉风)回复于 2002-08-20 13:38:33 得分 100
<html>
<head>
<title>test</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<BODY leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" >
<script language="VBScript">
function Sure()
msg="模拟手机"&document.form1.mobile.value&"发送消息"&document.form1.message.value&"吗?"
if (msgbox(msg,vbyesno+vbquestion,"确认发送吗?")=vbyes) then
form1.submit
end if
end function
</script>
<form name="form1" action="index.asp">
<input type="text" name="mobile">
<input type="text" name="message">
<input name="Button" type="button" id="tijiao" value="发送" onClick=sure()>
</form>
</body>
</html>
原因在于按钮的id也是submit,改id之后就好了Top
4 楼tdl982324(最爱宝宝的笨熊)回复于 2002-08-20 13:42:23 得分 0
试试document.formname.submit()
或者<input type=button name=button1>
<script language=javascript>
sub button1_onClick
dim confirm
confirm=msgbox("确认",vbYesNo,"确定要提交吗")
if confirm=vbyes then
document.formname.submit()
end if
end sub
</script>Top
5 楼x_q_y(清宇)回复于 2002-08-20 13:49:51 得分 0
谢谢MeXP(秦汉风)
我按照你的说法,我已经找到问题了,这就给你100分Top
6 楼meizz(梅花雪)回复于 2002-08-20 13:51:13 得分 0
<script language="VBScript">
function Sure()
msg="模拟手机"&document.form1.mobile.value&"发送消息"&document.form1.message.value&"吗?"
if(msgbox(msg,1,"确认发送吗?")=1) then
form1.submit()
end if
end function
</script>
<form name="form1" action=aa.asp method=post>
<input type=text name=mobile>
<input type=text name=message>
<input type=button value="发送" onClick="sure()">
</form>Top
7 楼x_q_y(清宇)回复于 2002-08-20 14:03:45 得分 0
谢谢MeXP(秦汉风)
我按照你的说法,我已经找到问题了,这就给你分Top




