Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 155
  • Last Modified:

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

<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
benzwong
Asked:
benzwong
1 Solution
 
choroqueCommented:
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
 
chterilCommented:
or simply:
<form name="f1" method="post" action='test.asp' target='nameofyournewwindow'>
<input type="Text" value="">
<input type="submit" value="Test" > 
</form>


0
 
WhitewolfCommented:
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
 
WhitewolfCommented:
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
 
benzwongAuthor Commented:
Thanks for ur help.At least I've learned something.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now