E
evanburen
I have a bi-dimensional array that looks like this. I could split this
up any I need to if there is a better method.
{1,COMS}{2,IBM}{3,F}
I want to use this array to populate a selectbox. The numeric value is
the option value and the text is the text I want the user to see. I'm
not sure what to do with the array once I get the data back and
populate my selectbox.
// Split the response into an array
results = xmlHttp.responseText.split("{");
var optn = document.createElement("OPTION");
optn.text = results[0];
optn.value = results[1];
document.myForm.mySelectbox.options.add(optn);
This is the end result I'm looking for from the array above
<form id="myForm">
<select name="mySelectBox">
<option value="1">COMS</option>
<option value="2">IBM</option>
<option value="3">F</option>
</select>
</form>
up any I need to if there is a better method.
{1,COMS}{2,IBM}{3,F}
I want to use this array to populate a selectbox. The numeric value is
the option value and the text is the text I want the user to see. I'm
not sure what to do with the array once I get the data back and
populate my selectbox.
// Split the response into an array
results = xmlHttp.responseText.split("{");
var optn = document.createElement("OPTION");
optn.text = results[0];
optn.value = results[1];
document.myForm.mySelectbox.options.add(optn);
This is the end result I'm looking for from the array above
<form id="myForm">
<select name="mySelectBox">
<option value="1">COMS</option>
<option value="2">IBM</option>
<option value="3">F</option>
</select>
</form>