title: How do I remove letters and dashes and dollar signs in a string using a regular expression?
body: <p>I'm trying to find all letters and dashes and dollar signs and remove them from a text box. </p>
  
  <pre><code>function numbersOnly()
  {
      if ($('.sumit').val().indexOf([A-Za-z-$])) {
          $('.sumit').val().replace([A-Za-z-$], "");
      }
  }
  </code></pre>
  
  <p>That's what I've got and I'm pretty sure it's wrong. I'm not too great with regular expressions, but I'm trying to learn them. Does anyone want to help me out and get me started with completing this function?</p>
  
  <p>So.. You've got the inputs.</p>
  
  <pre><code>&lt;div class="numInputRight"&gt;&lt;input type="text" class="sumit" name="sumAmount1"&gt;&lt;/div&gt;
  &lt;div class="numInputRight"&gt;&lt;input type="text" class="sumit" name="sumAmount2"&gt;&lt;/div&gt;
  &lt;div class="numInputRight"&gt;&lt;input type="text" class="sumit" name="sumAmount3"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>Then you've got the function:</p>
  
  <pre><code>numbersOnly = function()
  {
    $('.sumit').val().replace(/[A-Za-z$-]/g, "");
    alert($('.sumit').val());
    return false;
  }   
  </code></pre>
  
  <p>I'm alerting to determine if the replace is working. It's not.</p>