bmarzouk
Mar 29th, 2002, 06:25 PM
Hello,
I have two combo boxes (<SELECT>) in an HTML page, where the first combo is
the parent of the second. When the user select an item in the first combo box,
the second one will be filled with other values that depend on the value of the
first combo box. Ofcourse these values are given from database.
I have two solutions for this problem:
The first is that when the user select an option from the first value, The current
page will redirect to itself with this option value and get the related options values
for the second combo box to fill it, but I think that will be slow while it is easier than the second solution.
The second is to fill an array with all options values of the second combo box
and use JavaScript to fill the second combo box from this array.
Could any one help me with code for the second solution.
I need to know how to clear the combo box, how to fill it again and so on using JavaScript.
Thank you
I have two combo boxes (<SELECT>) in an HTML page, where the first combo is
the parent of the second. When the user select an item in the first combo box,
the second one will be filled with other values that depend on the value of the
first combo box. Ofcourse these values are given from database.
I have two solutions for this problem:
The first is that when the user select an option from the first value, The current
page will redirect to itself with this option value and get the related options values
for the second combo box to fill it, but I think that will be slow while it is easier than the second solution.
The second is to fill an array with all options values of the second combo box
and use JavaScript to fill the second combo box from this array.
Could any one help me with code for the second solution.
I need to know how to clear the combo box, how to fill it again and so on using JavaScript.
Thank you