Kylena
01-19-2005, 03:49 AM
Hi,
I'm trying to populate an empty select list with values that users will enter from a number of textboxes.
The list would contain the delimiter ":" separating the values.
I haven't have the faintest clue on how to populate the listbox.
What I have is (button called 'Add'):
function addToList()
{
var f = document.forms[0];
for (i = 0; i < listBox.length; i++)
{
if (f.textBox.value != null)
f.listBox[i].value = f.textBox.value;
break;
}
}
I know the code is wrong, but I don't know how to modify it. :confused:
I'm trying to populate an empty select list with values that users will enter from a number of textboxes.
The list would contain the delimiter ":" separating the values.
I haven't have the faintest clue on how to populate the listbox.
What I have is (button called 'Add'):
function addToList()
{
var f = document.forms[0];
for (i = 0; i < listBox.length; i++)
{
if (f.textBox.value != null)
f.listBox[i].value = f.textBox.value;
break;
}
}
I know the code is wrong, but I don't know how to modify it. :confused: