How to make text box only accept numbers?

I have created my own version of a Spin Box … Text field that is read only … placed in a horizontal box with a button in front of the field called - and one behind called +

Click - … take current value of field and subtract one … Click + … take current value of field and add one.

On some of my fields I have a max number and min number … if the user goes past that it just flicks back to the min and max depending on direction.

I have used a similar approach for fields that require almost a drop down feature … it allows me to control the values and I don’t have to deal with pesky little Drop Down Lists that are so small you can hardly read the text.