Results 1 to 3 of 3

Thread: Chained Select Menu Help

  1. #1
    Join Date
    Mar 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation Chained Select Menu Help

    1) Script Title: Chained Select Menu

    2) Script URL (on DD): http://dynamicdrive.com/dynamicindex...menu/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.

  2. #2
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    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:
    Code:
    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:
    Code:
    <input type="button" onclick="document.getElementById('image').src = returnVal(myset);">
    ...
    <img id="image">
    Whereas "myset" is the set name of the select group.
    - Mike

  3. #3
    Join Date
    Dec 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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..

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •