Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Align disabled state with email validation
Previously, the submit button of the "Add another email address" form would be disabled if an email didn't match the pattern "<something>@<something>.<something>". However, form submit was left to be handled by client-side validation by the browser. Thus, it was possible to submit the form with an email address that was technically valid (e.g. "testtest@mailinator") even though the submit button was still disabled. Thus, this change makes the button's disabled state depending on the browser's form validation. Note that I also added the check that some data was actually entered - the browser doesn't report on invalid form fields until the user has actually entered some data into that form. This is good UX, but the button can provide feedback earlier.
- Loading branch information