Client-side form validation using JavaScript