This JavaScript code allows keypress events for characters with charCodes between 48 (0) and 57 (9) (numeric digits) and also allows the decimal point with charCode 46.
Now, users will be able to input both integer and decimal numbers in the page item, and non-numeric characters will be restricted.