Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Passing an ID to a Pop up window
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Passing an ID to a Pop up window

 Post Reply Post Reply
Author
eagle307 View Drop Down
Newbie
Newbie


Joined: 18 May 2005
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote eagle307 Quote  Post ReplyReply Direct Link To This Post Topic: Passing an ID to a Pop up window
    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
 
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
Back to Top
bootcom View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 February 2005
Location: United Kingdom
Status: Offline
Points: 259
Post Options Post Options   Thanks (0) Thanks(0)   Quote bootcom Quote  Post ReplyReply Direct Link To This Post 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" target="_blank">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
Back to Top
eagle307 View Drop Down
Newbie
Newbie


Joined: 18 May 2005
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote eagle307 Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
bootcom View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 February 2005
Location: United Kingdom
Status: Offline
Points: 259
Post Options Post Options   Thanks (0) Thanks(0)   Quote bootcom Quote  Post ReplyReply Direct Link To This Post 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") %>')">
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.