how to create sub combo box for a main combo

December 22, 2010 at 02:40:30
Specs: Windows XP
I need to create additional sub combo boxes based on the values in main combo box for example., if i am selecting '2' in main combo box i need to get two sub combo boxes on the screen as one below the other.

See More: how to create sub combo box for a main combo

Report •

December 31, 2010 at 17:33:41
You *might* try something like below if it's what you're after; there's no effort to style anything.

<select onchange="addCBox(this.selectedIndex);">

<script type="text/javascript">

function addCBox(idx) {

   var brk, sel, opt;

   for(var i=0; i <= idx; i++) {

      brk = document.createElement("br");      
      sel = document.createElement("select");


      for(var j=0; j <= idx; ++j) {

         opt = document.createElement("option");

         opt.innerHTML = "sub (" + parseInt(i + 1) + ") : " + "index pos " + j;



Report •
Related Solutions

Ask Question