Improve Contact Form Validation and Accessibility#852
Merged
Conversation
Added comprehensive client-side validation with real-time feedback for the contact form. Users now get immediate, helpful error messages when they enter invalid data, making the form much easier to use. Changes made: - Added regex-based validation for name field (letters, spaces, hyphens, apostrophes only) - Enhanced email validation with proper regex pattern - Message length validation with min 10 and max 500 characters - Real-time error display as users type or leave fields - Visual error indicators with red borders and background highlighting - Accessible error messages with aria-invalid and aria-describedby attributes - Improved form accessibility with proper labels, autocomplete, and required attributes - Dark mode support for error states with appropriate color contrast - Replaced inline styles with proper CSS classes for back-to-top button - Better semantic HTML structure with form field grouping
…alidation Improve Contact Form Validation and Accessibility
👋 Thank you for opening this Pull Request!Your contribution is much appreciated. Our team will review it shortly. 🔎 In the meantime, please:
We look forward to collaborating with you. 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Enhanced the contact form with comprehensive client-side validation and improved accessibility features. This update provides users with immediate, helpful feedback when filling out the form, making it more user-friendly and reducing submission errors.
Related Issues
This enhancement improves the overall user experience of the contact form, addressing potential usability issues where users might submit invalid data without knowing what went wrong.
Changes Made
Checklist
Testing
Tested the form with various inputs:
This contribution maintains the existing design aesthetic while significantly improving the user experience and code quality of the contact form.