I need help on how to store data inserted in a list. Right now I have the following code that creates a list.
<select name = "lstTerminals" size = "5" id="lstTerminals" multiple="multiple" style="width:200px;">
</select>
As you can see, it has no parameters or values. To populate the list, I have a button where it can add values to it depending on what is entered from the text field. Below is a text box in which the user can put text
<input id="txtTerminal" type="text" name="txtTerminal" style="width:115px;"/>
Below is the button code
<input class = "buttonDesign" id="btnAddTerminal" name ="btnAddTerminal" type="button" onclick = "javaScript:addTerminal();"
value="Add Terminal" style="width:110px; height:25px"/>
Note that it has an onclick method where, when clicked, it inserts text from text input into its list. The following onclick javaScript:addTerminal()has 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;
}
, , , . : ( ) , , . , , ?