Immediate validation of fields

Hi to all,
Is it possible to immediately validate a field before moving the focus to another field on a form?
I’ll explain.
Suppose we have a form with several fields; for example

Code
Firstname
Surname
Address
VAT_number
and more...

I would like to validate the VAT number immediately before moving to another field.
For this validation I have php library with several functions.
If it is possible how can I do it in scriptcase?
Thank You and Best Regards
Gaetano