title: javascript regexp on keyup
body: <p>i'm trying to make script which will replace all unwanted characters (from regexp) in input on keyup event. I tried everything but nothing works for me...</p>
  
  <p>My code:</p>
  
  <pre><code>$('#form_accomodation_cell').on('keyup', 'input[name="accomodation_cell[]"]', function() {
  
      var value = $(this).val();
      var regex_cell = /^[0-9 \+]+$/g;
  
      if (!isNumeric(value, regex_cell))
      {
          var new_value = value.replace(regex_cell, '');
          alert(new_value);
      }
  
      function isNumeric(elem, regex_cell) {
          if(elem.match(regex_cell)){
              return true;
          }else{
              return false;
          }
      }
  
  });
  </code></pre>