title: jquery only allow numbers, comma's and dashes in input type
body: <p>I've got a <code>&lt;input type="text" name="pages" placeholder="Pagina's" /&gt;</code>. Now i want to only allow numbers, comma's and dashes to be in the input. How do i check this with jquery?</p>
  
  <p>So i only want to allow [0-9]-,</p>
  
  <pre><code>$("input[name=pages]").change(function (e) {
      //check if the input was other than a comma, dash or number and return false if so.
  });
  </code></pre>
  
  <p>How do i do this? I thought maybe use a regex but i can't find anything with regex in jquery.</p>