Joget DX Available for Download

Check out Joget DX, the next generation successor to Joget Workflow for faster, simpler digital transformation.

Skip to end of metadata
Go to start of metadata

To enforce keyboard entry so that users can only input numerical values for a text field


There are several online resources that describe this (e.g., etc.).

For example, if your text field ID is "numeric", you can use this sample script:

$(document).ready(function() {
    $("#numeric").keydown(function(event) {
        // Allow only backspace and delete
        if ( event.keyCode == 46 || event.keyCode == 8 ) {
            // let it happen, don't do anything
        else {
            // Ensure that it is a number and stop the keypress
            if (event.keyCode < 48 || event.keyCode > 57 ) {
  • No labels