asp如何能在打开一个网页的时候 自动提交表单呢?就是不点击提交按钮,自动提交后显示数据?代码如下
<%@LANGUAGE="VBSCRIPT"CODEPAGE="936"%><!--#includefile="chkadmin.asp"--><!--#includef...
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="chkadmin.asp"-->
<!--#include file="conn.asp"-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>电脑设备汇总统计</title>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>
<BODY>
<p align="center"></p>
<div align="center">
<script src="Mymodify.js"></script>
</div>
<p> </p>
<%
dim count
set ns=server.createobject("adodb.recordset")
nsql = "select * from bmb order by id"
ns.open nsql,conn,1,1
%>
<script language = "JavaScript">
var onecount;
onecount=0;
subcat = new Array();
<%
count = 0
do while not ns.eof
%>
subcat[<%=count%>] = new Array("<%= trim(ns("bm"))%>","<%= trim(ns("dw"))%>","<%= trim(ns("bm"))%>");
<%
count = count + 1
ns.movenext
loop
ns.close
%>
onecount=<%=count%>;
function changelocation(locationid)
{
document.form1.bm.length = 0;
var locationid=locationid;
var i;
for (i=0;i < onecount; i++)
{
if (subcat[i][1] == locationid)
{
document.form1.bm.options[document.form1.bm.length] = new Option(subcat[i][0], subcat[i][2]);
}
}
}
</script>
<form name="form1" method="post" action="pctongji_all.asp">
<p align="center">所属地区:
<select name="dw" id="dw" onChange="changelocation(document.form1.dw.options[document.form1.dw.selectedIndex].value)" size="1">
<option>淄博地区</option>
</select><p align="center">
<% if Session("qx")="9" Then %>
<select name="xzfw" id="xzfw" size="1">
<option value="dw">所属地区内电脑设备</option>
</select>
<% else %>
<select name="xzfw" id="xzfw" size="1">
<option value="dw">所属地区内电脑设备</option>
</select>
<% end if %>
</p>
<p align="center"> <input type="submit" name="Submit" value="统计">
</p>
</p>
</form>
<BR><BR><BR>
</BODY>
</HTML>
请问各位大大 能具体点吗?我是新手呢 展开
<!--#include file="chkadmin.asp"-->
<!--#include file="conn.asp"-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>电脑设备汇总统计</title>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>
<BODY>
<p align="center"></p>
<div align="center">
<script src="Mymodify.js"></script>
</div>
<p> </p>
<%
dim count
set ns=server.createobject("adodb.recordset")
nsql = "select * from bmb order by id"
ns.open nsql,conn,1,1
%>
<script language = "JavaScript">
var onecount;
onecount=0;
subcat = new Array();
<%
count = 0
do while not ns.eof
%>
subcat[<%=count%>] = new Array("<%= trim(ns("bm"))%>","<%= trim(ns("dw"))%>","<%= trim(ns("bm"))%>");
<%
count = count + 1
ns.movenext
loop
ns.close
%>
onecount=<%=count%>;
function changelocation(locationid)
{
document.form1.bm.length = 0;
var locationid=locationid;
var i;
for (i=0;i < onecount; i++)
{
if (subcat[i][1] == locationid)
{
document.form1.bm.options[document.form1.bm.length] = new Option(subcat[i][0], subcat[i][2]);
}
}
}
</script>
<form name="form1" method="post" action="pctongji_all.asp">
<p align="center">所属地区:
<select name="dw" id="dw" onChange="changelocation(document.form1.dw.options[document.form1.dw.selectedIndex].value)" size="1">
<option>淄博地区</option>
</select><p align="center">
<% if Session("qx")="9" Then %>
<select name="xzfw" id="xzfw" size="1">
<option value="dw">所属地区内电脑设备</option>
</select>
<% else %>
<select name="xzfw" id="xzfw" size="1">
<option value="dw">所属地区内电脑设备</option>
</select>
<% end if %>
</p>
<p align="center"> <input type="submit" name="Submit" value="统计">
</p>
</p>
</form>
<BR><BR><BR>
</BODY>
</HTML>
请问各位大大 能具体点吗?我是新手呢 展开
展开全部
一楼的那种应该也可以 没试过
其实也是js实现的
用js提交表单 放到body最后
页面加载完成自动提交
其实也是js实现的
用js提交表单 放到body最后
页面加载完成自动提交
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
把
<BODY>改成
<BODY onload="form1.submit()" >
<BODY>改成
<BODY onload="form1.submit()" >
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="chkadmin.asp"-->
<!--#include file="conn.asp"-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>电脑设备汇总统计</title>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>
<BODY>
<p align="center"></p>
<div align="center">
<script src="Mymodify.js"></script>
</div>
<p> </p>
<%
dim count
set ns=server.createobject("adodb.recordset")
nsql = "select * from bmb order by id"
ns.open nsql,conn,1,1
%>
<script language = "JavaScript">
var onecount;
onecount=0;
subcat = new Array();
<%
count = 0
do while not ns.eof
%>
subcat[<%=count%>] = new Array("<%= trim(ns("bm"))%>","<%= trim(ns("dw"))%>","<%= trim(ns("bm"))%>");
<%
count = count + 1
ns.movenext
loop
ns.close
%>
onecount=<%=count%>;
function changelocation(locationid)
{
document.form1.bm.length = 0;
var locationid=locationid;
var i;
for (i=0;i < onecount; i++)
{
if (subcat[i][1] == locationid)
{
document.form1.bm.options[document.form1.bm.length] = new Option(subcat[i][0], subcat[i][2]);
}
}
}
</script>
<form name="form1" method="post" action="pctongji_all.asp">
<p align="center">所属地区:
<select name="dw" id="dw" onChange="changelocation(document.form1.dw.options[document.form1.dw.selectedIndex].value)" size="1">
<option>淄博地区</option>
</select><p align="center">
<% if Session("qx")="9" Then %>
<select name="xzfw" id="xzfw" size="1">
<option value="dw">所属地区内电脑设备</option>
</select>
<% else %>
<select name="xzfw" id="xzfw" size="1">
<option value="dw">所属地区内电脑设备</option>
</select>
<% end if %>
</p>
<p align="center"> <input type="submit" name="Submit" value="统计">
</p>
</p>
</form>
<BR><BR><BR>
</BODY>
<script>
document.form1.submit();
</script>
</HTML>
<!--#include file="chkadmin.asp"-->
<!--#include file="conn.asp"-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>电脑设备汇总统计</title>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>
<BODY>
<p align="center"></p>
<div align="center">
<script src="Mymodify.js"></script>
</div>
<p> </p>
<%
dim count
set ns=server.createobject("adodb.recordset")
nsql = "select * from bmb order by id"
ns.open nsql,conn,1,1
%>
<script language = "JavaScript">
var onecount;
onecount=0;
subcat = new Array();
<%
count = 0
do while not ns.eof
%>
subcat[<%=count%>] = new Array("<%= trim(ns("bm"))%>","<%= trim(ns("dw"))%>","<%= trim(ns("bm"))%>");
<%
count = count + 1
ns.movenext
loop
ns.close
%>
onecount=<%=count%>;
function changelocation(locationid)
{
document.form1.bm.length = 0;
var locationid=locationid;
var i;
for (i=0;i < onecount; i++)
{
if (subcat[i][1] == locationid)
{
document.form1.bm.options[document.form1.bm.length] = new Option(subcat[i][0], subcat[i][2]);
}
}
}
</script>
<form name="form1" method="post" action="pctongji_all.asp">
<p align="center">所属地区:
<select name="dw" id="dw" onChange="changelocation(document.form1.dw.options[document.form1.dw.selectedIndex].value)" size="1">
<option>淄博地区</option>
</select><p align="center">
<% if Session("qx")="9" Then %>
<select name="xzfw" id="xzfw" size="1">
<option value="dw">所属地区内电脑设备</option>
</select>
<% else %>
<select name="xzfw" id="xzfw" size="1">
<option value="dw">所属地区内电脑设备</option>
</select>
<% end if %>
</p>
<p align="center"> <input type="submit" name="Submit" value="统计">
</p>
</p>
</form>
<BR><BR><BR>
</BODY>
<script>
document.form1.submit();
</script>
</HTML>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询