Print Page | Close Window

Passing an ID to a Pop up window

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=15141
Printed Date: 30 March 2026 at 6:55am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Passing an ID to a Pop up window
Posted By: eagle307
Subject: Passing an ID to a Pop up window
Date Posted: 18 May 2005 at 3:14pm

Hi all,

I am working on a project that involves creating a hyperlink that opens a new window.  This is a bit more than hyperlinking with javascript as well explained in this thread: http://forums.webwiz.net/forum_posts.asp?TID=14703&PN=1&TPN=2 - http://forums.webwiz.net/forum_posts.asp?TID=14703&PN=1&TPN=2
 
I have researched and looked at pop up generators but they do not help with passing on varaibles I have here. 
 
Here is what my code looks like now:
============================
 
 if display = "C" then
  response.write "<br><a href=""" & linked_page & "?id=" & data("id") & """>" & data("news_title") & "</a> <br>"
 end if
===========================
I would appreciate any advice on how I can get this to open in NEW window or pop up (popup).
 
many thanks for your help.
 
Eagle307



Replies:
Posted By: bootcom
Date Posted: 18 May 2005 at 3:19pm
To open it in a new window you could add the target attribute into your link ie: <a href="somelink?id=somevalue">something</a>
 
Or you could do it as a js function like so:
 

function openWin(id){
var win = window.open("blah.asp?id="+id+"", "windowname", "features")
}
 
Thats how I do it and all works fine


Posted By: eagle307
Date Posted: 18 May 2005 at 4:01pm
Thanks bootcom.
 
I was not "born a programmer" and do not know how to implement your suggestion.  Javascript sounds like the better option as you can control window size etc. 
 
How would you do add javascript to my code?
 
Thanks again for your help.


Posted By: bootcom
Date Posted: 18 May 2005 at 4:03pm
Well using the example function I gave ... put that in the head tag of your document and call it as a link like so:
 

<a href="#" onClick="openWin('<%= data("id") %>')">



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net