Page 1 of 1

On select open popup and main window

Posted: Thu Jul 29, 2004 10:51 pm
by zeroanarchy
Hi all,

Thanks for taking the time to help

Ok I have no ideas if this is possible and if so how one would do it. What I am tring to do is on select from a dropdown if selection = option 2 then open main page as option2.php and open a popup page pop.php but if the user selects option 1,3,4 then just open the selected main page.

Now the problem is that I can not build the popup code into the page option2.php as it is an outside page.

Any ideas?

Thanks again for your time.
zeroanarchy

Code: Select all

<select onchange="window.location.pathname=this.options&#1111;this.selectedIndex].value">
<option selected value"http://www.mypage.com/S/A.php"> -- Select a number --</option>
  <option value="/S/option1.php">option 1</option>
  <option value="/S/option2.php">option 2</option>
  // what do I need to add to the above line to make it open a popup as  
  // well or is there a better way of doing this?
  <option value="/S/option3.php">option 3</option>
  <option value="/S/option4.php">option4</option>
</select>

Posted: Thu Jul 29, 2004 11:12 pm
by feyd
option2.php should open the popup probably...

Posted: Fri Jul 30, 2004 9:35 am
by pickle

Code: Select all

<script language = "javascript">
function do_stuff(p_value)
&#123;
   if(p_value == "/S/option2.php")
   &#123;
      window.open("/S/pop.php","popupWindow","resizable=false.........");
   &#125;
   
   window.location.href = p_value;
&#125;
</script>
.
.
.
.
.
     

<select onchange = "javascript:do_stuff(this.value);">
<option>
.
.
.
.
</select>
Untested and probably syntactically wrong somewhere, but you get the idea.