自动ASP页面提交? [英] automatic ASP page submission?
问题描述
我正在尝试自动将表单提交到另一个ASP页面
some< input>字段值由ASP填充。
我知道我可以使用javascript来完成它,但有没有办法使用VBscript自动提交表单?
? br />
特里
<%
''...一些asp处理
value1 =" something"
value2 =" somethingelse"
%>
< form method =" ;交"行动= QUOT; mynextpage.asp" ID = QUOT; form1的" name =" form1">
< input TYPE =" hidden"名称= QUOT; VAR1" VALUE =" &安培; <%=值1%GT; &安培; ">"
< input TYPE =" hidden"名称= QUOT; VAR2" VALUE =" &安培; <%=值2%GT; &安培; ">"
< / form>
<%
''form1.submit()' '这显然不会做任何事情
%>
< script language =" JavaScript" type =" text / javascript">
//这样可行,但有办法在vbscript中执行此操作。
form1.submit();
< / script>
I''m trying to automatically submit a form to another ASP page after
some <input> fields values are filled by ASP.
I know I can do it using javascript, but is there a way to
automatically submit the form using VBscript?
Terry
<%
'' ... some asp processing
value1 = "something"
value2 = "somethingelse"
%>
<form method="post" action="mynextpage.asp" id="form1" name="form1">
<input TYPE="hidden" name="var1" VALUE=" & <%=value1%> & ">"
<input TYPE="hidden" name="var2" VALUE=" & <%=value2%> & ">"
</form>
<%
'' form1.submit() '' this obviously wouldn''t do anything
%>
<script language="JavaScript" type="text/javascript">
// this works but is there a way to do it in vbscript.
form1.submit();
</script>
推荐答案
如果您要张贴到自己的页面,为什么还需要?你不能只是
执行serveR上的代码吗?为什么要创建一个由ASP代码确定的值为
的表单,然后将其提交回同一个服务器?
Ray at work
" Terry" < SA ******** @ shaw.ca>在消息中写道
news:9a ******************************** @ 4ax.com ...
Why do you need to if you''re posting to your own page? Can''t you just
execute the code on the serveR? Why create a form that has values
determined by ASP code and then submit it back to the same server?
Ray at work
"Terry" <sa********@shaw.ca> wrote in message
news:9a********************************@4ax.com...
我正试图在
某些< input>之后自动将表单提交到另一个ASP页面。字段值由ASP填充。
我知道我可以使用javascript来实现它,但有没有办法使用VBscript自动提交表单?
特里
<%
''...一些asp处理
value1 =" something
value2 =" somethingelse"
%>
< form method =" post"行动= QUOT; mynextpage.asp" ID = QUOT; form1的" name =" form1">
< input TYPE =" hidden"名称= QUOT; VAR1" VALUE =" &安培; <%=值1%GT; &安培; ">"
< input TYPE =" hidden"名称= QUOT; VAR2" VALUE =" &安培; <%=值2%GT; &安培; ">"
< / form>
<%
''form1.submit()''这显然不会做任何事情>%>
< script language =" JavaScript" type =" text / javascript">
//这有效,但有办法在vbscript中执行此操作。
form1.submit();
< / script>
I''m trying to automatically submit a form to another ASP page after
some <input> fields values are filled by ASP.
I know I can do it using javascript, but is there a way to
automatically submit the form using VBscript?
Terry
<%
'' ... some asp processing
value1 = "something"
value2 = "somethingelse"
%>
<form method="post" action="mynextpage.asp" id="form1" name="form1">
<input TYPE="hidden" name="var1" VALUE=" & <%=value1%> & ">"
<input TYPE="hidden" name="var2" VALUE=" & <%=value2%> & ">"
</form>
<%
'' form1.submit() '' this obviously wouldn''t do anything
%>
<script language="JavaScript" type="text/javascript">
// this works but is there a way to do it in vbscript.
form1.submit();
</script>
Terry于2003年12月16日在microsoft.public.inetserver.asp.general写道:
Terry wrote on 16 dec 2003 in microsoft.public.inetserver.asp.general:
我正在尝试自动提交
一些< input>之后的表单到另一个ASP页面字段值由ASP填充。
我知道我可以使用javascript来实现它,但有没有办法使用VBscript自动提交表单?
特里
<%
''...一些asp处理
value1 =" something
value2 =" somethingelse"
%>
< form method =" post"行动= QUOT; mynextpage.asp" ID = QUOT; form1的" name =" form1">
< input TYPE =" hidden"名称= QUOT; VAR1" VALUE =" &安培; <%=值1%GT; &安培; ">"
< input TYPE =" hidden"名称= QUOT; VAR2" VALUE =" &安培; <%=值2%GT; &安培; ">"
< / form>
<%
''form1.submit()''这显然不会做任何事情>%>
< script language =" JavaScript" type =" text / javascript">
//这有效,但有办法在vbscript中执行此操作。
form1.submit();
< / script>
I''m trying to automatically submit a form to another ASP page after
some <input> fields values are filled by ASP.
I know I can do it using javascript, but is there a way to
automatically submit the form using VBscript?
Terry
<%
'' ... some asp processing
value1 = "something"
value2 = "somethingelse"
%>
<form method="post" action="mynextpage.asp" id="form1" name="form1">
<input TYPE="hidden" name="var1" VALUE=" & <%=value1%> & ">"
<input TYPE="hidden" name="var2" VALUE=" & <%=value2%> & ">"
</form>
<%
'' form1.submit() '' this obviously wouldn''t do anything
%>
<script language="JavaScript" type="text/javascript">
// this works but is there a way to do it in vbscript.
form1.submit();
</script>
< script type =" text / vbscript">
form1.submit()
< / script>
仅适用于IE !!!
为什么要这样做?
您是否将vbs与(asp)服务器端和js与客户端混淆?
===================
你想要这样做:
<%
session(" value1")= value1
session(" value2")= value2
response redirect" myNextpage.asp"
%>
>
和onmyNextpage.asp
<%
value1 = session(" value1")
value2 =会话(" value2")
%>
===============
或
<%
回应se重定向myNextpage.asp?""" value1"&"&"&" value2"
%>
和onmyNextpage.asp
<%
value1 = request.querystring(" value1")
value2 = request.querystring(" value2")
%>
-
Evertjan。
荷兰。
(请将x''es更改为我的电子邮件地址中的点数)
<script type="text/vbscript">
form1.submit()
</script>
Only for IE !!!
Why would you want to do that ?
Are you confusing vbs with (asp)serverside and js with clientside ?
===================
Would you want to do this:
<%
session("value1")=value1
session("value2")=value2
response redirect "myNextpage.asp"
%>
and on "myNextpage.asp"
<%
value1=session("value1")
value2=session("value2")
%>
===============
or
<%
response redirect "myNextpage.asp?"&"value1"&"&"&"value2"
%>
and on "myNextpage.asp"
<%
value1=request.querystring("value1")
value2=request.querystring("value2")
%>
--
Evertjan.
The Netherlands.
(Please change the x''es to dots in my emailaddress)
2003年12月15日星期一18 :50:51 -0500,Ray at<%= sLocation%>
< myfirstname at lane34 dot com>写道:
On Mon, 15 Dec 2003 18:50:51 -0500, "Ray at <%=sLocation%>"
<myfirstname at lane34 dot com> wrote:
为什么你需要发布到你自己的页面?你不能只是执行serveR上的代码吗?为什么要创建一个由ASP代码确定的值的表单,然后将其提交回同一个服务器?
Ray at work
Why do you need to if you''re posting to your own page? Can''t you just
execute the code on the serveR? Why create a form that has values
determined by ASP code and then submit it back to the same server?
Ray at work
Ray,Evertjan,
感谢您的回复。
我会提供更多信息。我试图保持简短和
可能会因为说''myNextPage.asp'而使事情变得混乱... ...
页面实际上是在第三方服务器上。
我正在尝试创建一个标准化的ASP页面,我可以调用它来处理2个(或更多)不同的信用卡处理方法。我们的第三方供应商之一接受使用查询字符串的帖子。
其他供应商接受表格发布。因此修改后的代码可能看起来像这样:$ / b
还有更好的处理吗?
Terry
<%
''此ASP页面由我们用户的付款方式调用
''。 。页面指定要使用哪个bankVendor。
''...一些初始处理来填充我们的数据库
value1 =" something"
value2 =" somethingelse"
''等
如果BankVendor =" A"然后
Response.redirect" https://www.bankA.com/payment.asp?" &安培; _
" merchant_id =" &安培;价值1& "&安培;" &安培; " OrdNum = QUOT; &安培; value2
elseif BankVendor =" B"然后
%>
< form method =" post" action =" https://www.bankB.com/payment.asp"
id =" form1" name =" form1">
< input TYPE =" hidden"名称= QUOT; MERCHANT_ID" VALUE =" &安培; <%=值1%GT; &安培; ">"
< input TYPE =" hidden"名称= QUOT; OrdNum" VALUE =" &安培; <%=值2%GT; &安培; ">"
< / form>
<%
''如果BankVendor =" B" ;,然后我想提交表格
< script language =" JavaScript" type =" text / javascript">
//这样可行,但有办法在vbscript中执行此操作。
form1.submit();
< / script>
结束如果
%>
Ray, Evertjan,
Thank you for the responses.
I will give a little more info. I was trying to keep it short and
probably confused things a bit by saying ''myNextPage.asp'' ... that
page is actually on a 3rd party server.
I am trying to create a standardized ASP page I can call that will
handle 2 (or more) different processing methods for credit cards. One
of our 3rd party vendors accepts a post using a querystring. The
other vendor accepts a form post. So the modified code might look
something like this:
Is there a better to handle this?
Terry
<%
'' this ASP page is called by our user''s payment form
'' .. the page specifies which bankVendor to use.
'' ... some initial processing to populate our database
value1 = "something"
value2 = "somethingelse"
'' etc.
if BankVendor="A" then
Response.redirect "https://www.bankA.com/payment.asp?" & _
"merchant_id=" & value1 & "&" & "OrdNum=" & value2
elseif BankVendor="B" then
%>
<form method="post" action="https://www.bankB.com/payment.asp"
id="form1" name="form1">
<input TYPE="hidden" name="merchant_id" VALUE=" & <%=value1%> & ">"
<input TYPE="hidden" name="OrdNum" VALUE=" & <%=value2%> & ">"
</form>
<%
'' if BankVendor = "B", then I want to submit the form
<script language="JavaScript" type="text/javascript">
// this works but is there a way to do it in vbscript.
form1.submit();
</script>
end if
%>
>
这篇关于自动ASP页面提交?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!