How do I check that the text written in a textbox is an integer value (and not for example string or other type)?

Additionally, is it possible to make a textbox "locked" to a certain input format such that it is just possible to write dates in the form xxxx-xx-xx (for example 1987-01-03) in to the textbox?

Thx for help.

Regards,


Marcus