title: Jquery Validator and Mask Plugin
body: <p>I used the Input Mask Jquery plugin to mask the credit card field.
  My code in masking is as follows:</p>
  
  <pre><code>$(".cardField").mask("9999 9999 9999 9999");
  </code></pre>
  
  <p>The problem is i have also used the validator plugin with the following condition:</p>
  
  <pre><code>rules: {
      cardField: {
          required: true,
          digits: true,
          minlength: 16,
          maxlength: 16
      }
   }
  </code></pre>
  
  <p>Now whenever i type something, it always results to an error because of the spaces.
  How can i solve this?</p>
  
  <p>Also, before I submit it back using the $post, i want to return it as a number without spaces. I used the unmasked() method but it returns an object instead. </p>
  
  <pre><code>var creditCardValue = $(".cardField").unmask().mask("9999 9999 9999 9999");
          $(".cardField").val(creditCardValue);
  </code></pre>
  
  <p>so how i can do this correctly?</p>
  
  <p>Thank you.</p>