PDA

View Full Version : Chained Select Menu Help



convoy90
04-09-2007, 02:24 PM
1) Script Title: Chained Select Menu

2) Script URL (on DD): http://dynamicdrive.com/dynamicindex1/chainedmenu/index.htm

3) Describe problem: When I submit the selected item in the Chained Menu, I would like to output it not in another screen/window but in another table on the same page. I am trying to make a website similar to what car companies do on their websites on the "Build-A-Car" section. I would like to output the selection into another frame/table in list form while in another it outputs a picture of the selected item. Is there a way to do this without trying the script in more than one place?

I would appreciate any help.

mburt
04-09-2007, 06:40 PM
Okay... I get your point. I think the most logical thing to do would be to assign source names for each option tag, and then append the src to an image.
So make a new function called returnVal:

function returnVal(){
for (i=arguments.length-1;i>=0; i--){
if (arguments[i].selectedIndex!=-1){
var selectedOptionvalue=arguments[i].options[arguments[i].selectedIndex].value
if (selectedOptionvalue!=""){
return selectedOptionvalue
}
}
}
}

Then have your first argument the set name:
So:

<input type="button" onclick="document.getElementById('image').src = returnVal(myset);">
...
<img id="image">
Whereas "myset" is the set name of the select group.

dian
12-05-2008, 02:24 PM
how if i want to open the document in the same window? i mean, there's an iframe below chained menu, so.. if i click the third level, the document will be open in an iframe below that menu.

can you help me,please?
thanks before. i'm new here.. :)