Input text field questions

[font=verdana, arial, helvetica][size=2]
Couple of questions that someone may be able to answer…

When using an input text field, can the entering or leaving the field (TAB and/or mouse selection of the field) be detected?

Second question… Is there a way to restrict an input text field to numbers only?[/size][/font]