Client side validation for login and registration forms