N
N
NeveR3d2018-03-07 14:02:08
JavaScript
NeveR3d, 2018-03-07 14:02:08

Symbols are not deleted on android 4.4.4?

$(function() {
  $(".cardnumber").mask("9999-9999-9999-9999-99");
  $(".cardnumber").on("blur", function() {
    var last = $(this).val().substr($(this).val().indexOf("-") + 1);

    if (last.length == 5) {
      var move = $(this).val().substr($(this).val().indexOf("-") + 1, 1);

      var lastfour = last.substr(1, 4);

      var first = $(this).val().substr(0, 9);

      $(this).val(first + move + '-' + lastfour);
    }
  });
});

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<input type="tel" class="cardnumber" name="cardcode" pattern="[0-9]{4}\s[0-9]{4}\s[0-9]{4}\s[0-9]{4}" placeholder="XXXX XXXX XXXX XXXX XXXX">

jQuery Browser Plugin 0.1.0 included When you try to remove characters, they just don't get removed.
Here is the video https://yadi.sk/i/D7skJxKD3T7L5U

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question