enhanced client-side form validation