title: Meteor: use dropdown menu to get data from mongodb and show results
body: <p>I'm new from Meteor, and I need to realize a little dropdown menu and a search with the selected data in the dropdown menu.</p>
  
  <p>I have <code>devices.html</code> :</p>
  
  <pre><code>&lt;div class="ha_panel-selections"&gt;
      &lt;form id="plane-form"&gt;
          &lt;select id="plane-select"&gt;
              &lt;option disabled="disabled" selected="selected"&gt;Please Select&lt;/option&gt; 
              {{#each plane}}
                  &lt;option id="plane_selected" value="{{this}}"&gt;{{this.planeid}}&lt;/option&gt;
              {{/each}}
          &lt;/select&gt;
      &lt;/form&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>the data comes from the database: <code>devices.js</code> is:</p>
  
  <pre><code>    Template.devices.helpers({
          plane: function() {
              return plane.find({});
          }
      });
  </code></pre>
  
  <p>Now what I want to do is take the selected value in the dropdown menu (the <code>plane.planeid</code> value), search in the db for that value, and print the data associated: 
  so for example, if I select "plane1" I can see planeid, flighttime, pilotname, ecc; if I change from "plane1" to "plane2" the data will change accordingly.</p>
  
  <p>How can I pass the <code>plane_selected</code> value from html to devices.js? and back, once i will find the data in the db, how can I print the results passing the data form <code>devices.js</code> to <code>devices.html</code> ?</p>
  
  <p>I think it should be (in <code>devices.js</code>) something like</p>
  
  <pre><code>Template.devices.events({
      "change #plane-form": function (event, template) {
          //console.log("event: " + util.inspect(event) );
          //console.log("template: " + util.inspect(template) );
          var selected = Session.get("plane_selected");
          console.log("selected: " + selected);
      }
  });
  </code></pre>
  
  <p>What I'm doing wrong?</p>