I need help on how to store the data inserted in the list box. Right now I have the following code that creates list.
<select name = "lstTerminals" size = "5" id="lstTerminals" multiple="multiple" style="width:200px;">
</select>
As you can see it has no option or values at all. In order to fill the list, I have a button where it can add values to it depending what is input from a text field. The following is the text field where the user can put text
<input id="txtTerminal" type="text" name="txtTerminal" style="width:115px;"/>
The code below is the button
<input class = "buttonDesign" id="btnAddTerminal" name ="btnAddTerminal" type="button" onclick = "javaScript:addTerminal();"
value="Add Terminal" style="width:110px; height:25px"/>
Notice it has an onclick method where when clicked, it will insert the text from the text input into my list box. The following onclick javaScript:addTerminal()
has the javascript code:
function addTerminal() {
var terminal = document.getElementById('txtTerminal');
var terminals = document.getElementById('lstTerminals');
var values = new Array();
var option = document.createElement("option");
option.value = terminal.value;
option.text = terminal.value;
terminals.add(option);
return true;
}
Once the listbox is filled with text, I should be able to get those text individually and move to another page to display each in a certain way. The question I have now is how can I store all those values (without selecting) inside the list box and maybe store it into an array. Once that is done, how can I call that array and use it into another page to display its values from the previous page?