HELP! Need popup to check link of parent page and display html based on that link

Posted on 2004-04-08
Medium Priority
Last Modified: 2012-05-04
Hello experts! As the title suggests I would like to make a popup that first checks the link of it’s parent.   Based on that link it then displays the picture for the popup, and also the wood options.  For better understanding of the latter, please view the following page and click on the thumb “stains”.


As you can see the woods are limited to only burl.  However if you had gone to this page and clicked on the “stains thumb”…


You would find that your options are Elm and Gingko.

Currently I am just linking to two separate pages.  I would rather not make a different page for each and every product, so I feel this mini-database would be the answer.  I would also like the page to be cached so the user need only load the list of variables once.

Here is the code of the current popup:
<title>Stains and Hardware</title>
function goto()
     self.resizeTo(document.images[0].width+15, document.images[0].height+132);

function getSelectValue(selObject){
  return selObject.options[selObject.selectedIndex].value;
function chimg(){
  var d = document.forms[0];
  var w = getSelectValue(d.wood);
  var s = getSelectValue(d.stains);
  var h = getSelectValue(d.hardware);
  var elem = document.getElementById("help");
  if(getSelectValue(d.wood) && getSelectValue(d.stains) && getSelectValue(d.hardware)){
  //alert(wood);alert(stain);alert(hardware); //Debugging
  document.images["myimg"].src = "http://www.greenteadesign.com/images/custom/"+ w +"-"+ s +"-"+ h +".jpg";
  elem.innerHTML="<img name=myimg src=http://www.greenteadesign.com/images/custom/"+ w +"-"+ s +"-"+ h +".jpg>";
       return true;
       alert("Please select all options!");
         return false;
<body onLoad=goto() bgcolor="#B6CAAE" style="margin-left: 0; margin-top: 0; margin-bottom: 0; margin-right: 0">
<div align=center valign=middle>
<div id=help><img name=myimg src="http://www.greenteadesign.com/images/custom/burl-gp-bh.jpg" alt=""><br></div>
<table border=0 cellspacing=cellpadding=0>
        <td width=478 height=2 bgcolor="#ffffff"><img src="http://www.greenteadesign.com/images/blank.gif" width=478 height=1><br></td>
        <td width=478 height=2 bgcolor="#647F5B"><img src="http://www.greenteadesign.com/images/darkgreen.gif" alt="" border=0 width=1 height=1><br></td>
<form name=imgform onsubmit="">

<SELECT NAME="wood">
      <OPTION VALUE="">- - - Select Wood - - -</OPTION>
      <OPTION VALUE="burl">Burl</OPTION>

<SELECT NAME="stains">
      <OPTION VALUE="">- - - Select Stain - - -</OPTION>
      <OPTION VALUE="gp">Golden Pecan</OPTION>
      <OPTION VALUE="fw">Fruitwood</OPTION>
      <OPTION VALUE="ro">Red Oak</OPTION>
      <OPTION VALUE="mh">Mahogany</OPTION>
      <OPTION VALUE="ch">Chocolate</OPTION>
      <OPTION VALUE="wn">Walnut</OPTION>

<SELECT NAME="hardware">
      <OPTION VALUE="">- - Select Handle - -</OPTION>
      <OPTION VALUE="bh">Brass Hirute</OPTION>
      <OPTION VALUE="ih">Iron Hirute</OPTION>
      <OPTION VALUE="bw">Brass Warabite</OPTION>
      <OPTION VALUE="iw">Iron Warabite</OPTION>
      <OPTION VALUE="ik">Iron Kakute</OPTION>

<input type=button onClick="return chimg();" value="Go" style="color: #FFFFFF; background-color: #8B987C; border-width: 1; border-style: 1">

<div align=left><font size=+1>&nbsp<b> For more information on how to order this piece <a href="order.html" target=_blank>click here</a>.</b></font></div>


As always, your help is greatly appreciated,

(P.S. Is there a better solution via php?)
Question by:Quarfelburg
1 Comment
LVL 12

Accepted Solution

monosodiumg earned 1000 total points
ID: 10788028
Not sure I see the problem. You can avoid multiple popups by resuing hte same window by giving the popup window a name and then looking for it.
If you can do server side stuff then you need only on php page which takes the type of furniture as an argument and generate the HTML as per your code but with the differnt sets of options. It's output is targeted (target attribute of link or URL arg in window.open) to the popup. You only create the popup window if none exists already (and, optionally, you close it when you go to a different page).


Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

This article discusses how to create an extensible mechanism for linked drop downs.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

587 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question