View Single Post
  #2 (permalink)  
Old February 7th, 2007, 02:15 AM
mike_remember mike_remember is offline
Friend of Wrox
Points: 1,935, Level: 17
Points: 1,935, Level: 17 Points: 1,935, Level: 17 Points: 1,935, Level: 17
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2004
Location: United Kingdom
Posts: 550
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi

You can use the JS function below to fullfil your requirement:

function AddItems()
        {
            var myForm = document.Form1; //Form Name
            var mySel = myForm.sel; // Listbox Name
            var myOption;

            myOption = document.createElement("Option");
            myOption.text = document.getElementById("txt").value; //Textbox's value
            myOption.value = document.getElementById("txt").value; //Textbox's value
            mySel.add(myOption);
        }

Regards
Mike

Fortune favours the brave, so don't regret on missed oppurtunities.