dependent select boxes

Ask a Question related to Macromedia Dynamic HTML, Design and Development.

  1. #1

    Default dependent select boxes

    Hello, as seen at:

    [url]http://www.macromedia.com/support/dreamweaver/ts/documents/client_dynamic_listbo[/url]
    x.htm

    i'm using that script, the only problem, I can't find a way to make the
    default selection of the CHILD'S selectedIndex
    anyone has an idea how to do it ?

    Daniel.

    daniel82e Guest

  2. Similar Questions and Discussions

    1. Creating client-side dynamic dependent list boxes in ASP
      I am trying to link two list boxes on a page using client side java. I am using Macromedia's Tech Note on this issue but still cannot get it to...
    2. Related Select Boxes - MX7
      I have been having quiet some difficulties understanding the binding that has to be done to bind between one CFSELECT result and the bind to the...
    3. Cannot select graphic boxes
      I cannot select graphic boxes on my document pages. I created the graphic boxes and text columns on the master pages. I set the graphic boxes to...
    4. A selection changes on asp page with 6 dependent list boxes, when back
      Hello I have 6 dependent list boxes on my ASP page:  Faculty;  Lecturer;  Course;  Course occurrence;  Group;  Week commencing date....
    5. Moving data between select boxes
      Hi I have used ASP code to load data into two select boxes. The code below is used to move the selected data back and forth between the boxes. ...
  3. #2

    Default Re: dependent select boxes

    in the loop in populateDynaList, you'd just check to see if the value you just
    used to create the new option was the default. If it is, you'd set a variable
    (I used myIndex) to the current loop counter (i) and use this variable instead
    of setting the selected index=0 at the end of the function. I haven't tested
    it, but it would look something like this:

    function populateDynaList(oList, nIndex, aArray){
    myIndex=0; // initialze the variable
    for (var i = 0; i < aArray.length; i= i + 3){
    if (aArray == nIndex){
    oList.options[oList.options.length] = new Option(aArray[i + 1], aArray[i +
    2]);
    if(oList.options[i+1].value == **defaultValue goes here**){
    myIndex=i+1;
    }
    }
    }

    if (oList.options.length == 0){
    oList.options[oList.options.length] = new Option("[none available]",0);
    }
    oList.selectedIndex = myIndex;

    }



    emo Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139