Hi Folks,
I have designed a dynamic drop down list but having problems since it is not working as intended. Please help
The above is the rough code like what i am trying to achieve. Please help me with this subject.
Thanks in advance!!
Chandhseke
I have designed a dynamic drop down list but having problems since it is not working as intended. Please help
Code:
<html>
<head>
<Script language="Javascript">
var Select = new Array("-----");
var test = (
"Select",
"ITEM 1",
"ITEM 2",
"ITEM 3",
"ITEM 4");
var test 1("Select",
"Product 1",
"Product 2",
"Product 3",
"Product 4");
function swap(the_array_name)
{
var numbers_select = window.document.Formname.Product;
var the_array = eval(the_array_name);
setOptionText(window.document.Formname.Product,the_array);
}
function setOptionText(the_select, the_array)
{
var c;
the_select.length=the_array.length;
for (c=0; c < the_array.length; c++)
{
the_select.options[c].text = the_array[c];
}
}
</script>
<form name="Formname">
<tr><td>
<select name="item" onchange="swap(window.document.Formname.item.options[selectedIndex].value);">
<option value="1">Test</option>
<option value="2">Test 1</option>
</select>
<select name="Product">
<option selected>Select</option>
</select>
</form>
</html>
<form name
Thanks in advance!!
Chandhseke
Comment