Adding support for numpad in textboxes
I'm currently trying to get input from the num pad to work as input for a textbox.
This is my current validation function: I know that everything below the regex works for numbers on the keyboard. What it does is it checks if the full string in the textbox is smaller than 1, if so it can add one number between 0 and 8. Then if there is already one number, but a backspace is pressed, the number can be removed. (after which the length is again smaller than 1 so a new number can be input). In any other scenario nothing should be added. So things such as an 'A' or 83234213 are not possible.
What I try to do with the regex is take the input from a num pad number, which is num_1, num_2 etc and strip it from everything but the number, so that just a 0 to 8 is left over. It should then be able to accept it as an input, but nothing happens when I fill it in in the text box.
What solution to the current code can I add to include input from the num pad?