Removal of repetitive symbols (Suppression)



  • We need to remove the symbols in the field.

    I do that.

    $('#tochange').bind("change keyup paste input", function(e) {
        $(this).val($(this).val().replace(/[&<>"'\/;:%^?]/,""));
    });
    

    But if you put a few things the same, like, ''''''''':::: Some of them are left and then wiped out as they enter, how to be?



  • Add the modifier global.g😞

    $(this).val($(this).val().replace(/[&<>"'\/;:%^?]/g,""));
    

    This would replace all the said signs not once, but throughout the length of the text. ♪ ♪




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2