Solved

How to submit a form to an ASP file in a new window?

Posted on 2000-03-30
5
147 Views
Last Modified: 2010-04-09
<form action="Test.asp" method="post">
<input type="Text" value="" >
<input type="submit" value="Test" >
</form>
I want to post the form to Test.asp in a new window but not in the same window. What should i do?
0
Comment
Question by:benzwong
5 Comments
 
LVL 1

Expert Comment

by:choroque
ID: 2671534
try this:

<form name="f1" method="post">
<input type="Text" value="">
<input type="button" value="Test" onclick="submit1()">
</form>

<script language="javascript">
function submit1(){
document.f1.action="test.asp";
document.f1.target ="_parent"
document.f1.submit();
}
</script>
0
 

Expert Comment

by:chteril
ID: 2672182
or simply:
<form name="f1" method="post" action='test.asp' target='nameofyournewwindow'>
<input type="Text" value="">
<input type="submit" value="Test" > 
</form>


0
 
LVL 1

Expert Comment

by:Whitewolf
ID: 2679396
here is my suggestion, it may be a bit easier than the other examples...

on the asp page, you can use the following commands such as...

request.form("variable")

this allows you to request the form information that you recieved on the previous page and you can use it on the next page either by setting it to a value like...

variable=request.form("variable")
obviously you need to put a variable name where ever I put the word variable.

Now to print this information to the asp screen you merely need to use the following commands...

response.write ("whatever you wanna say" & variable)

OR

response.write(request.form("variable"))

either one will work, the first is nice if you want to format or use the data and manipulate it before you put it onto the browser screen in the new asp page.

Hope this helps,
Whitewolf

For more help, email me
jgebelt@hotmail.com


0
 
LVL 1

Accepted Solution

by:
Whitewolf earned 50 total points
ID: 2679397
here is my suggestion, it may be a bit easier than the other examples...

on the asp page, you can use the following commands such as...

request.form("variable")

this allows you to request the form information that you recieved on the previous page and you can use it on the next page either by setting it to a value like...

variable=request.form("variable")
obviously you need to put a variable name where ever I put the word variable.

Now to print this information to the asp screen you merely need to use the following commands...

response.write ("whatever you wanna say" & variable)

OR

response.write(request.form("variable"))

either one will work, the first is nice if you want to format or use the data and manipulate it before you put it onto the browser screen in the new asp page.

Hope this helps,
Whitewolf

For more help, email me
jgebelt@hotmail.com


0
 

Author Comment

by:benzwong
ID: 2682193
Thanks for ur help.At least I've learned something.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now