Improve client side validation of forms