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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Assistance needed with window.open statement!!

Status
Not open for further replies.

YodaMan81

Technical User
Jul 8, 2003
94
0
0
US
I want to have a pop up window on our website only if a certain condition is true. Below is the basic gist of the code I need. I dont know how to combine the response.write statement with the window.open statement. Thanks in advance for any help!!!

<%
dim pop
pop = rs.Fields(&quot;Status&quot;)
If pop=&quot;AC&quot; then
window.open('open.html','op',config='height=300,width=300')
%>

 
try this

<%
dim pop
pop = rs.Fields(&quot;Status&quot;)
If pop=&quot;AC&quot; then
%>
<script language=&quot;text/javascript&quot;>
window.open('open.html','op',config='height=300,width=300')
<script>
<%
End If
%>
 
Thanks Simon but I got an error when I used the info. above. The error was &quot;A script block cannot be placed inside another script block. &quot;

I have made some progress using this code, but I am not sure how to limit the size of the window. The one that works is below:


dim pop
pop = rs.Fields(&quot;Status&quot;)
url = &quot;map.asp&quot;
If pop=&quot;AC&quot; then
response.write(&quot;<script>&quot;)
response.write(&quot;window.open('&quot; & url & &quot;');&quot; & vbCrLf)
response.write(&quot;</script>&quot;)
 

YodaMan,

Change your
Code:
window.open
line to read:

Code:
response.write(&quot;window.open('&quot; & url & &quot;', 'myWin', 'width=300,height=400');&quot; & vbCrLf)

Hope this helps!

Dan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top