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.
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);"> <option>1</option> <option>2</option> <option>3</option> <option>4</option> </select> <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"); document.body.appendChild(brk); for(var j=0; j <= idx; ++j) { opt = document.createElement("option"); opt.innerHTML = "sub (" + parseInt(i + 1) + ") : " + "index pos " + j; sel.appendChild(opt); } document.body.appendChild(sel); } } </script>