title: How to get selected dropdown value in Node app
body: <p>With a handlebar home.handlebars that has this dropdown menu for gender as part of the registration form...</p>
  
  <pre><code>&lt;form id="register-modal" class="ui modal form" method="post" action="/register"&gt;
    &lt;div class="field"&gt;
      &lt;label&gt;Username&lt;/label&gt;
      &lt;input type="text" name="username" placeholder="Username"&gt;
    &lt;/div&gt;
    &lt;div class="field"&gt;
    &lt;div class="two fields"&gt;
      &lt;div class="field"&gt;
        &lt;label&gt;Age&lt;/label&gt;
        &lt;input type="text" name="age"&gt;
      &lt;/div&gt;
      &lt;div class="field"&gt;
        &lt;label&gt;Gender&lt;/label&gt;
        &lt;select class="ui fluid dropdown"&gt;
          &lt;option value="male"&gt;Male&lt;/option&gt;
          &lt;option value="female"&gt;Female&lt;/option&gt;
          &lt;option value="non-binary"&gt;Non-binary&lt;/option&gt;
        &lt;/select&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
   &lt;div class="field"&gt;
      &lt;label&gt;Email Address&lt;/label&gt;
      &lt;input type="text" name="email" placeholder="Email Address"&gt;
    &lt;/div&gt;
    &lt;div class="field"&gt;
      &lt;label&gt;Password&lt;/label&gt;
      &lt;input type="password" name="password" placeholder="Password"&gt;
    &lt;/div&gt;
    &lt;center&gt;&lt;button class="ui button" type="submit"&gt;Submit&lt;/button&gt;&lt;/center&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>I have a function that creates a new user object like this...</p>
  
  <pre><code>function user(name, pass) {
     return {
        name: name,
        pass: pass
     };
  }  
  </code></pre>
  
  <p>Here is how I'm retrieving the information from the form. This is <code>routes.js</code>:</p>
  
  <pre><code>router.post('/register', (req,res) =&gt; {
  var name = req.body.username;
  var pass = req.body.password;
  var email = req.body.email;
  
  if (!name || !pass || !email ) {
    res.redirect('registration?code=fail');
  } else{
  db.insertUser(creations.user(name,pass,email,false),(user) =&gt; {
    if(user){
      db.login(user,(sessionID)=&gt;{
        res.cookie('sessionID', sessionID);
        res.redirect('/feed');
      })
    } else res.redirect('registration?code=IU');
  })
  }})
  </code></pre>