Horje
Number format only in input Code Example
Number format only in input
// Restricts input for the given textbox to the given inputFilter function.
function setInputFilter(textbox, inputFilter) {
  ["input", "keydown", "keyup", "mousedown", "mouseup", "select", "contextmenu", "drop"].forEach(function(event) {
    textbox.addEventListener(event, function() {
      if (inputFilter(this.value)) {
        this.oldValue = this.value;
        this.oldSelectionStart = this.selectionStart;
        this.oldSelectionEnd = this.selectionEnd;
      } else if (this.hasOwnProperty("oldValue")) {
        this.value = this.oldValue;
        this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
      } else {
        this.value = "";
      }
    });
  });
}




Whatever

Related
primeng p-calendar autofocus Code Example primeng p-calendar autofocus Code Example
.chartjs-render-monitor Code Example .chartjs-render-monitor Code Example
how often api deprecated Code Example how often api deprecated Code Example
.cs to exe in commandline Code Example .cs to exe in commandline Code Example
underscore in footnote Code Example underscore in footnote Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8