ian27
12-13-2004, 04:39 AM
Hi guys,
Okay, this is where I am at so far. I'm using the ComboBox component to add a drop down menu to a webpage I'm building. I've scripted it so that when I click to a particular label it opens up the appropriate url. This is the script I have at present:
-----------------------------------
ComboBox.addItem("Select...", "");
ComboBox.addItem("Item1", "http://www.item1.com");
ComboBox.addItem("Item2", "http://www.item2.com");
ComboBox.addItem("Item3", "http://www.item3.com");
// establish component listener
lo = new Object();
lo.change = function (evt) {
// take action
trace("Selected data is: " + evt.target.getValue() );
trace(" Label = " + evt.target.selectedItem.label);
trace(" Data = " + evt.target.selectedItem.data);
trace(newline);
my_url = evt.target.getValue();
if (my_url != "") {
getURL(my_url);
}
}
ComboBox.addEventListener("change", lo);
-----------------------------------------
The problem:
Instead of a new URL opening up in the same browser window when I click on the appropriate label, I want a pop-up window to appear instead containing the information from the chosen url.
How can I do this?
I hope this makes sense.
Thank you.
Ian
Okay, this is where I am at so far. I'm using the ComboBox component to add a drop down menu to a webpage I'm building. I've scripted it so that when I click to a particular label it opens up the appropriate url. This is the script I have at present:
-----------------------------------
ComboBox.addItem("Select...", "");
ComboBox.addItem("Item1", "http://www.item1.com");
ComboBox.addItem("Item2", "http://www.item2.com");
ComboBox.addItem("Item3", "http://www.item3.com");
// establish component listener
lo = new Object();
lo.change = function (evt) {
// take action
trace("Selected data is: " + evt.target.getValue() );
trace(" Label = " + evt.target.selectedItem.label);
trace(" Data = " + evt.target.selectedItem.data);
trace(newline);
my_url = evt.target.getValue();
if (my_url != "") {
getURL(my_url);
}
}
ComboBox.addEventListener("change", lo);
-----------------------------------------
The problem:
Instead of a new URL opening up in the same browser window when I click on the appropriate label, I want a pop-up window to appear instead containing the information from the chosen url.
How can I do this?
I hope this makes sense.
Thank you.
Ian