title: How to write validation functions for jQuery mobile input type range?
body: <p>Following problem: 
  I have some input fields of type range. jQuery mobile automatically transforms them into an input field with a slider aside. What I want to do is instant validation while typing. The validation script shall remove all non-digits. The function I use works on input field text but not for input type range.</p>
  
  <p>This is my html:</p>
  
  <pre><code>&lt;label for="my_range_input_field"&gt;label_text:&lt;/label&gt;
  &lt;input data-type="range" type="range" name="my_range_input_field" id="my_range_input_field" value="10000" min="0" max="85000"  /&gt;
  </code></pre>
  
  <p>This is my jQuery validation function:</p>
  
  <pre><code>$(document).delegate('#my_range_input_field', 'input', function(e) {
      $(this).val($(this).val().replace(/[^\d]/g, ""));
  });
  </code></pre>
  
  <p>The problem is, that this function deletes the whole input value and not just the non digits. I tried to debug and when using console.log to display the val I saw that it was always an empty string when not only digits were typed in the input field. I did some research and found the following: 
  <a href="https://stackoverflow.com/questions/18852244/how-to-get-the-raw-value-an-input-type-number-field">How to get the raw value an &lt;input type=&quot;number&quot;&gt; field?</a></p>
  
  <p>So there is something like a pre-validation and it seems that I can't retrieve the value I want because it's invalid and displays as empty string. Is there still a way to get that value? </p>
  
  <p>Or is there at least something like a <code>:invalid</code> selector for input fields of type range to show the user a red background or something?</p>