Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Community Discussions (All other subjects)
 Javascript: Is this possible....
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

xstream
Junior Member

242 Posts

Posted - 10 February 2003 :  17:50:03  Show Profile  Visit xstream's Homepage  Send xstream an AOL message  Send xstream an ICQ Message
I've searched all over for this and haven't seen anything like it, but can this be done.

I have a drop down list on one of our forms at work. I wanted to have a pop up occur when certain items are selected. Someone suggested this:

<script>
function openPop(val){
    if(val==1)
         window.open('page.htm','popWin','height=200,width=200);
}
</script>
<select name="select" onChange="openPop(this.value);return false;">
<option value="0" selected>Select Item</option>
<option value="1">Item 1</option>
<option value="0">Item 2</option>
<option value="1">Item 3</option>
</select>


But this only allows one page to pop up for all items, and I lose the value of the form field for the item (it needs a value of 1 for the pop up to occur). Any ideas?

X

DavidRhodes
Senior Member

United Kingdom
1222 Posts

Posted - 10 February 2003 :  18:09:38  Show Profile
you need something like

<script>
function openPop(val){
window.open('page.asp?val='+ val,'popWin','height=200,width=200);
}
</script>
<select name="select" onChange="openPop(this.value);return false;">
<option value="0" selected>Select Item</option>
<option value="1">Item 1</option>
<option value="0">Item 2</option>
<option value="1">Item 3</option>
</select>


then use request.querystring("val") to retrieve the value

The UK MkIVs Forum

Edited by - DavidRhodes on 10 February 2003 18:10:33
Go to Top of Page

xstream
Junior Member

242 Posts

Posted - 10 February 2003 :  18:20:25  Show Profile  Visit xstream's Homepage  Send xstream an AOL message  Send xstream an ICQ Message
Would something like this work:


<script>
function openPop(val){
    switch(val) {
    case 1:
      window.open('products.asp#option1','popWin','height=200,width=200);
    case 2:
      window.open('products.asp#option2','popWin','height=200,width=200);
    case 3:
      window.open('products.asp#option3','popWin','height=200,width=200);
    case 4:
      window.open('products.asp#option4','popWin','height=200,width=200);
    default:
      window.open('products.asp#default','popWin','height=200,width=200);
  }
}
</script>

<select name="select" onChange="openPop(this.value);return false;">
<option value="0" selected>Select Item</option>
<option value="1">Item 1</option>
<option value="2">Item 2</option>
<option value="3">Item 3</option>
</select>
Go to Top of Page

xstream
Junior Member

242 Posts

Posted - 10 February 2003 :  19:57:06  Show Profile  Visit xstream's Homepage  Send xstream an AOL message  Send xstream an ICQ Message
Came up with a solution...


<select name="solicitation" onChange="if(this.value!=0) window.open(this.value,'popWin','height=400,width=400,screenX=400,screenY=400,top=0,left=500,scrollbars=yes');return false;">
  <option selected value="None">Please Select Item Cross Sold</option>
<% for i = 0 to ubound(products,2) %>
<option value="<%=products(2,i) %>"><%=products(1,i) %></option>
<% next %>
</select>
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.29 seconds. Powered By: Snitz Forums 2000 Version 3.4.07