Solved

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

Posted on 2000-03-30
5
146 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks for ur help.At least I've learned something.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
HTML 5 canvas - stretch image to the canvas width and height 6 26
Ajax control editor 4 31
Animate a Title 7 34
HTML Lists 3 29
Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

744 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

8 Experts available now in Live!

Get 1:1 Help Now