Reputation: 69
I have the following input box in one html page. When I type the number on this column the value is not being changed without enter or tab key. The onkeypress has been given common js file for entire html. So I cannot change there . I scare it will affect other working html. Is it possible to call trigger change event in a loop for all input text inside a table 'table' from javascript of that html. So it will make the change event for all the input text under that table
<input type="text" class="borderless-text-sm form-control input-mini" onkeypress="return (event.charCode >= 48 && event.charCode <= 57) ||event.charCode == 46 || event.charCode == 0 || event.charCode == 13|| event.charCode == 9|| event.charCode == 16" min="0" max="24" step="any" autocomplete="off" style="padding-right: 24px;">
Upvotes: 2
Views: 77
Reputation: 544
Try adding oninput="return (event.charCode >= 48 && event.charCode <= 57) ||event.charCode == 46 || event.charCode == 0 || event.charCode == 13|| event.charCode == 9|| event.charCode == 16"
to the input.
Upvotes: 0
Reputation: 63
I guess you are looking for onblur
?
https://www.w3schools.com/jsref/event_onblur.asp
Upvotes: 2