Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open a new browser window! 1

Status
Not open for further replies.

sera

Technical User
Jun 29, 2000
360
US
Hello all,
I have a form that queries a database. I would like the result (processed with ASP) to pop up in a new browser window. Does anyone know how to do this?
Thanks,
Sera
 
Sera,

In your html/asp page

<a href=&quot;javascript:somefunction('txthere')&quot;>Click me</a>



<script language=&quot;javascript&quot;>
function somefunction(strtxt)
{
x = window.open(' + strtxt', 'New Window', 'width=400, height=400,left=350,top=200,scrollbars=yes,resizable=yes,dependent=yes');
x.focus();
}
</script>

fengshui_1998
 
I guess that I am unable to make this work. I am running the asp script off of a form post right now. I tried to adapt it to your method but I am not sure that I know asp well enough to get your method to work. Maybe you will see what I am doing wrong.

Here is how I added it in my html page(the one that calls asp):

<a href=&quot;javascript:somefunction()&quot;>Click me</a>
<script language=&quot;javascript&quot;>
function somefunction()
{
var search_term;
var x;
search_term = window.SelectKeyword.value;
alert(search_term);

x = window.open('test_search_alaska.asp?searchterm=' + search_term , 'New Window', 'width=400, height=400,left=350,top=200,scrollbars=yes,resizable=yes,dependent=yes');
x.focus();
}
</script>


Here is the line that I changed in my asp code:

searchterm = Request.QueryString(&quot;searchterm&quot;)

Sera
I often believe that...
My computer is possessed!
 
sera,

try using this two files..

-- MyASPPage.asp

<html>
<body>
<form name=&quot;myform&quot;>
<input type=&quot;text&quot; name=&quot;mytext&quot; size=10>
<a href=&quot;javascript:somefunction()&quot;>Click me</a>

</form>
</body>
<script language=&quot;javascript&quot;>
function somefunction()
{
var x;
var search_term = document.myform.mytext.value;
alert(search_term);
x = window.open('test_search_alaska.asp?searchterm=' + search_term, 'title', 'width=400, height=400, left=350, top=200,scrollbars=yes,resizable=yes,dependent=yes');
x.focus();

}
</script>
</html>

-- test_search_alaska.asp

<html>

<body>

<%
strInput = request.querystring(&quot;searchterm&quot;)
response.write &quot;This was received: &quot; & strInput
%>
</body>
</html>


fengshui_1998
 
I am out of the office now! I will try out your solution Monday early...I will get back to you and let you know how it works. Thank You,
Sera
I often believe that...
My computer is possessed!
 
I sure do wish I could give you more stars. I suppose that is why the forum administrators only allow me to give one. That works beautifully and I really appreciate your help. Thanks for coming back and checking up on me!
Sera
I often believe that...
My computer is possessed!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top