Skip to content

[Draft] Feature: Add client-side form validation (Issue #3)#473

Draft
MTDev2024 wants to merge 47 commits intoOpenClassrooms-Student-Center:masterfrom
MTDev2024:master
Draft

[Draft] Feature: Add client-side form validation (Issue #3)#473
MTDev2024 wants to merge 47 commits intoOpenClassrooms-Student-Center:masterfrom
MTDev2024:master

Conversation

@MTDev2024
Copy link
Copy Markdown

This draft PR introduces the first implementation of client-side form validation to address Issue #3.

✅ Work included so far

  • Form validation on firstname, lastname, email, birthdate, quantity
  • Selection check for tournament location (radio)
  • Required checkbox check for terms and conditions
  • Clear, field-specific error messages to guide user inputs
  • Refactored HTML to improve accessibility:
    • Use of <fieldset> and <legend> for radio/checkbox groups
    • ARIA enhancements and better screen reader support
  • Refactored class names in HTML & CSS for consistency:
    • .form-label-checkbox, .form-label-radio, .checkbox-input, etc.

🛠️ Work still in progress

  • Displaying all validation error messages visibly under each field
  • Improving visual feedback (colors, spacing, etc.)
  • Possible cleanup of redundant code blocks

ℹ️ This PR is marked as a draft and is not yet ready for merge.

MTDev2024 added 10 commits July 17, 2025 03:27
- Added <legend> elements with .sr-only class for radio and checkbox groups to enhance screen reader support
- Corrected <fieldset> usage with a single <legend> per fieldset
- Removed invalid attributes (ex : width=auto on <img>)
- Unified text styling between <label> and <legend> for visual consistency
- Enhanced modal semantics with aria-labelledby and logical structure
…hdate, and quantity inputs. Display console messages for each validation case.
…heckbox, form-label-radio)

Replaced generic class names like checkbox-label and checkbox2-label
with more descriptive alternatives specific to input types.
@MTDev2024 MTDev2024 marked this pull request as draft July 21, 2025 23:58
MTDev2024 added 19 commits July 22, 2025 02:14
- Replaced <span> with <button> for better semantic and keyboard accessibility
- Added aria-label=Close modal for screen readers
- Reset button default styles using �ll: unset to preserve custom styles
- Maintained original close icon design with CSS pseudo-elements
…ton issues

- Split modal functionality into two separate JS files for clarity
- Ensure each modal has its own open/close functions
- Fix 'Close' button at the bottom of confirmation modal
- Add keyboard support (Escape key) for both modals
- Use DOMContentLoaded to attach event listeners safely
…amic class switching

- Implemented  and  styles for user feedback
- Updated submit handler to toggle classes based on validation result
- Ensured message container updates text and style dynamically
- Preserved existing form data logging functionality
…idation and modal scripts

- Added comments to real-time input validation event listeners
- Documented form submission flow with detailed notes on data retrieval, validation, and success
- Improved readability of modal open/close logic with step-by-step comments
- Ensured comments remain concise, relevant, and pedagogical to satisfy project requirements
- Adjusted hero-section height and margins in media queries
- Ensured body and main elements don't overflow viewport
- Fixed content being cut off at the bottom on mobile devices
- Hide opaque background (.bground) on small screens
- Ensure .content fills all available space below nav (80px)
- Add margin-top and height calc() for proper positioning
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.

1 participant