Hi,
Use javascript client side validation for that.

Core java