title: Meteor.js Validation w/ Mesosphere
body: <p>I'm trying to implement <a href="https://github.com/copleykj/Mesosphere" rel="nofollow">Mesosphere</a> for validation into my meteor app but it seems like Mesosphere isn't picking up on some of the native validations I've listed.</p>
  
  <p>I tried just a single validation for formatting of email and it's required length. For example:</p>
  
  <pre><code>Mesosphere({
      name: 'signupForm',
      method: 'signupUser',
      fields: {
          email: {
              required: true,
              format: 'email',
              rules: {
                  exactLength: 4
              },
              message: 'Wrong length'
          }
      },
      onFailure: function (errors) {
          messages = [];
  
          messages = _.map(errors, function (val, err) {
              console.log(val.message);
          });
      },
      onSuccess: function (data) {
          alert("Totally worked!")
      }
  });
  </code></pre>
  
  <p>The 'onFailure' (and onSuccess) callback seems to work because it is logging something when I submit the form. Which makes me believe I have it set up properly on the form submit event too. There you pass the form object to Mesosphere to create the validationObject if I understand it correctly. For example:</p>
  
  <pre><code>var validationObject = Mesosphere.signupForm.validate(accountData);
  </code></pre>
  
  <p>Once submitted, it's logging <em>Field Required</em> as the error which is weird because I did type something into the field. It makes no mention of an incorrect length or format. It skips the 'Wrong Length' message and I can't find that message in the object anywhere.</p>
  
  <p>So my question is what am I doing wrong to not be getting the proper message for the incorrect input for that form field? Thanks : )</p>
  
  <p>Also, willing to take recommendations on other validation packages. Mesosphere leverages Meteor's server/client features for validation so it seemed like a good place to start.</p>
  
  <p>Template:</p>
  
  <pre><code>&lt;template name="signup"&gt;
        &lt;form name="signupForm" id="signup-form" class="panel" action="#"&gt;
          &lt;div class="form-group"&gt;
            &lt;label for="email"&gt;Email&lt;/label&gt;
            &lt;input type="text" name="email" id="email" class="form-control" /&gt;
          &lt;/div&gt;
  
          &lt;div class="form-group"&gt;
            &lt;label for="password"&gt;Password&lt;/label&gt;
            &lt;input type="password" name="password" id="password" class="form-control" /&gt;
          &lt;/div&gt;
  
          &lt;div class="form-group"&gt;
            &lt;input type="submit" value="Sign Up" id="create-account" class="btn btn-success pull-right"&gt;
          &lt;/div&gt;
        &lt;/form&gt; &lt;/template&gt;
  </code></pre>
  
  <p>Which calls this method in the corresponding file:</p>
  
  <pre><code>  signupUser: function(accountData) {
      var uid = Accounts.createUser(accountData);
    }
  </code></pre>