title: mask for comma separated numbers list
body: <p>I'm trying to creat a mask for comma separated values for my inputs, but I'm having dificulties.</p>
  
  <p>Can you guys help me?</p>
  
  <p>Here is my current mask:</p>
  
  <pre><code>&lt;script&gt;
      $(document).on("keyup keydown keypress", "commaseparated", function (e) {
          if (!$(this).val().match(/^([0-9]{0,1})(,[0-9]{1,}){1,}?$/g)) {
              e.preventDefault();
          }
      });
  &lt;/script&gt;
  &lt;input type="text" class="commaseparated" /&gt;
  &lt;!-- example input would be
       1235 &lt;- single number
       or
       2654,524874,5456 &lt;- many numbers
  --&gt;
  </code></pre>
  
  <p>Thanks in advance :)</p>
  
  <p><strong>EDIT</strong>
  Well, this is not exactly a mask. What I want is that the user can only insert numbers and commas, e.g:</p>
  
  <pre><code>123 -&gt; allowed
  123,123 -&gt; allowed
  123,, -&gt; not allowed
  123,letters -&gt; not allowed
  </code></pre>