We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1
<h2>JavaScript input filter showcase</h2>
<p>Supports Copy+Paste, Drag+Drop, keyboard shortcuts, context menu operations,
non-typeable keys, the caret position, different keyboard layouts, and <a href="https://caniuse.com/#feat=input-event" target="_blank">all browsers since IE 9</a>.</p> <p>There is also a <a href="https://jsfiddle.net/emkey08/tvx5e7q3" target="_blank">jQuery version</a> of this.</p> <table> <tr><td>Integer</td><td><input id="intTextBox"></td></tr> <tr><td>Integer >= 0</td><td><input id="uintTextBox"></td></tr> <tr><td>Integer >= 0 and <= 500</td><td><input id="intLimitTextBox"></td></tr> <tr><td>Float (use . or , as decimal separator)</td><td><input id="floatTextBox"></td></tr> <tr><td>Currency (at most two decimal places)</td><td><input id="currencyTextBox"></td></tr> <tr><td>A-Z only</td><td><input id="latinTextBox"></td></tr> <tr><td>Hexadecimal</td><td><input id="hexTextBox"></td></tr> </table>
// Restricts input for the given textbox to the given inputFilter.