-
Notifications
You must be signed in to change notification settings - Fork 38
Open
Description
If you want, for example, capture onchange event for force only numbers, you can't.
In the same manner you can't catch keypress or so.
Any way, I propouse to add at least onchange event. For this I propouse:
Keyboard.prototype.printChar = function(char) {
var selStart = this.$current_input[0].selectionStart;
var selEnd = this.$current_input[0].selectionEnd;
var textAreaStr = this.$current_input.val();
var value = textAreaStr.substring(0, selStart) + char + textAreaStr.substring(selEnd);
this.$current_input.val(value).focus();
++++ this.$current_input.trigger('change'); //ADD THIS FOR FIRE CHANGE EVENT 2018-11
this.$current_input[0].selectionStart = selStart+1, this.$current_input[0].selectionEnd = selStart+1;
};
Now you can add this:
onchange="this.value=this.value.replace(/[^\d]/,'');"
to any input and force only integer numbers.
hongtan and dmy-tro
Metadata
Metadata
Assignees
Labels
No labels