Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
How to restrict an input field to a numeric input field using JavaScript - implement the HTML input box
<input id="txtCurrency" name="txtCurrency" placeholder="" maxlength="10" class="numeric form-textbox" pattern="^(?:\d*\.\d{1,2}|\d+)" title="Value should be numeric with maximum two decimal points"/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.