Thierry Posted June 8, 2007 Share Posted June 8, 2007 I have a dropdown in a form, and based on what you select in that dropdown, another dropdown can contain various options. I'm using the script below but it gives the "not supported by this object" error, although it does manage to create the first option succesfully, but none of the others. $counter = 0; while($row = mssql_fetch_array($result)){ $uur_id = $row["uur_id"]; $uur_naam = $row["uur_naam"]; if($counter == 0){ ?> <script language="Javascript"> <!-- var dropdown = parent.document.getElementById("uur_id"); var keuzevak = new Option; <? } ?> keuzevak.text = "<? echo $uur_naam; ?>"; keuzevak.value = "<? echo $uur_id; ?>"; dropdown.options[<? echo $counter; ?>] = keuzevak; <? ++$counter;} ?> --> </script> Any idea what I'm doing wrong? EDIT: Never mind, forgot to put the New Option part within the loop. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.