title: How to get all items in multi list in bottle?
body: <p>I have a form that allows me to add to a multi list using js. I want to be able to post all the data in that list to my bottle server, but I am not able to get any of the data in there. How do I get all the items in my  statement to be posted to server.py? How do I access this post data once it is posted?</p>
  
  <p>Relevant code:</p>
  
  <p>server.py:</p>
  
  <pre><code>@bottle.route('/saveList', method='POST')
  def save_list():
      forms = bottle.request.get('the_list')
      print forms # returns 'None'
      return bottle.redirect('/updatelist') # just redirects to the same page with a new list
  </code></pre>
  
  <p>list.tpl</p>
  
  <pre><code> &lt;select multiple="multiple" id="the_list" name="the_list"&gt;
       %for item in my_ list:
       &lt;option&gt;{{item}}&lt;/option&gt;
       %end
   &lt;/select&gt;
  </code></pre>
  
  <p>EDIT:</p>
  
  <p>I am trying to get the whole list, not just the selected values. The user adds to the multi by way of textfield, button, and JS; so I want to get all the values (or all the new values).</p>
  
  <p>EDIT 2:</p>
  
  <p>I used the answers provided along with some js to get the desired result:</p>
  
  <pre><code>$('.add_to_the_list').click(function (e) {
  ...
  var new_item = $('&lt;option&gt;', {
                  value: new_item_str,
                  text: new_item_str,
                  class: "new_item" // the money-maker!
              });
  ...
  
  function selectAllNewItem(selectBoxId) {
      selectBox = document.getElementById(selectBoxId);
      for (var i = 0; i &lt; selectBox.options.length; i++) {
          if (selectBox.options[i].className === "new_item") { // BOOM!
              selectBox.options[i].selected = true;
          }
      }
  }
  
  ...
      $('#submit_list').click(function (e) {
          selectAllNewBG("the_list")
      });
  </code></pre>