Struts, Dynamicly fill html:select tag

How to dinamicly fill <html:select>..I.E. I have array of string <% String[] arr = {"Hello", "World", "!!!!!"};%>
[287 byte] By [Del2a] at [2007-11-27 5:35:25]
# 1

Get the array values in javascript and populate thro' js.

function getValues (){

var myArray = '<%= arr %>';

var val = myArray.split(",");

for(i = 0; i < val.length; i++){

addOptions(document.getElementById("mycombobox"), val[i], val[i]);

}

}

function addOptions(selectbox,text,value)

{

var optn = document.createElement("OPTION");

optn.text = text;

optn.value = value;

selectbox.options.add(optn);

}

skp71a at 2007-7-12 15:04:26 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
without JavaScript ?
Del2a at 2007-7-12 15:04:26 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
In your action class, use java split function and put each value in the arraylist, like myArray.add(eachVal);then, myForm.setMyCombo(arraylist);
skp71a at 2007-7-12 15:04:26 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...