title: How to get form values in meteor?
body: <p>I am getting an error <code>Uncaught TypeError: Cannot read property 'value' of undefined</code> however it is something to do with the way how I am calling the event.</p>
  
  <p>Here is a skeleton of my code:</p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;template name="register"&gt;
      &lt;form&gt;
          &lt;input type="text" name="username"&gt;
          &lt;input type="email" name="email"&gt;
          &lt;input type="password" name="password"&gt;
  
          &lt;button type="button" class="register"&gt;Register&lt;/button&gt;
      &lt;/form&gt;
  &lt;/template&gt;
  </code></pre>
  
  <p><strong>JavaScript</strong></p>
  
  <pre><code>Template.register.events({
      'click .register': function(e) {
          e.preventDefault();
          var getUser = e.target.username.value;
          var getEmail = e.target.email.value;
          var getPassword = e.target.password.value;
  
          console.log("user: " + getUser);
      }
  )};
  </code></pre>
  
  <p>I feel like there is something to do with the <code>click event</code> button class, which is returning no values. I tried using the <code>submit event</code>, but I've no idea how to retrieve values.</p>