title: Store javascript values in a ListBox (ASP.NET)
body: <p>I have a button which opens a popup window and lets me to choose something from a list and then returns to parent page with the ID and NAME variables. In the parent page, I store ID in an hidden field and NAME in a textbox. 
  This is ok when i choose one thing from list. But now I want to choose multiple things and store ID's and NAME's in a listbox value and text property.
  How can I do that?
  These are the javascript codes I am using for textbox and hidden field.</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
    function get_selected_machine(ID, NAME) {
        document.getElementById("txtName").value = NAME;
        document.getElementById("hdnID").value = ID;
      }
  &lt;/script&gt;
  </code></pre>