How to set a TextBox to only accept Numbers?
The easy way is to bind it to Model's field of Number type. In this case App Maker will take care about the user's input validation (on some extent).
If you want to have more control then you can script your custom validation rules in the textbox's onValidate
event and play with its configuration in the Data Validation properties section.
If you want to explicitly forbid user to enter everything but numbers, then you'll need to go down the native JS way and handle keyboard events or any other approach mentioned here: HTML text input allows only numeric input. You can hack into in onAttach
event of the textbox widget. To get widget's DOM element you can use this code: widget.getElement()
.