Loading into listbox

Results 1 to 2 of 2

Thread: Loading into listbox

  1. #1
    Join Date
    Dec 1969

    Default Loading into listbox

    Basically I want to load values into a list box that has already been filled. I want whatever is in a text box to be loaded into the listbox when a button is clicked. The values should be loaded into the list box after the ones that have been loaded in there already when the page loads up. Anyone have any suggestions, thanks in advance.

  2. #2
    Joe Mac Guest

    Default RE: Loading into listbox

    here is a client side function you should call onclick of the button<BR><BR>&#060;script language=Javascript&#062;<BR>function fillTheListBox(){<BR> var textBoxValue = document.yourTextBoxName.value;<BR> var indexOfLastItem = document.yourListBoxName.options.length;<BR> document.yourListBoxName.options[indexOfLastItem + 1] = new Option(valueVariableGoesHere , textBoxValue);<BR> // you might not need to add one to the index. not sure. try it both ways<BR>}<BR>&#060;/script&#062;<BR><BR>Let me know how this works.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts