Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #2: Enhance Form Validation and Improve HTML Accessibility #415

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

maxdnc
Copy link

@maxdnc maxdnc commented Feb 18, 2024

Fix issue #2: This pull request addresses several improvements to the form validation logic and HTML structure.
Key changes:

  1. HTML Accessibility: Linked labels to their corresponding input fields using "for" and "id" attributes. This improves the accessibility and usability of the form.

  2. Form Validation: Implemented comprehensive form validation using pure JavaScript. The form now validates correctly when the user clicks on "Submit". The following fields are validated:

    • First Name: Must be at least 2 characters long and cannot be empty.
    • Last Name: Must be at least 2 characters long and cannot be empty.
    • Email: Must be a valid email address.
    • Birthday: Must be a valid date.
    • Number of Competitions: Must be a numeric value.
    • Radio Button: One must be selected.
    • Terms and Conditions Checkbox: Must be checked. The other checkbox is optional and can be left unchecked.
  3. Form Data Persistence: The form now retains its data when it fails validation. This improves user experience as the user does not have to re-enter all the data if they make a mistake.

These changes improve the robustness of our form validation and the accessibility of our HTML code, leading to a better user experience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant