-
Notifications
You must be signed in to change notification settings - Fork 138
Closed
Copy link
Labels
Milestone
Description
Is there an existing issue for this?
- I have searched the existing issues
Feature Description
Currently, the contact form relies on default Bootstrap/browser validations (e.g., HTML5 required attribute showing "Please fill out this field").
This provides a poor user experience and inconsistent error handling across browsers.
We need to implement advanced custom validations with better control, customization, and user-friendly error messages.
Use Case
Proposed Improvements:
-
Custom Validation Rules
- First Name & Last Name: Minimum 2 characters, alphabets only.
- Email: Valid email format check (regex-based).
- Subject: Mandatory selection from the dropdown.
- Message: Minimum 10 characters required.
-
Inline Error Messages
- Display error messages directly under the respective input fields.
- Example:
- β "First name must be at least 2 characters long."
- β "Please enter a valid email address."
-
Real-time Validation
- Validate fields on blur and while typing instead of only on submit.
- Highlight invalid fields with a red border and error message.
-
Accessibility
- Ensure ARIA roles and attributes for screen readers.
- Clear error summaries for users relying on assistive technologies.
-
Validation Library (Optional)
- Consider using lightweight validation libraries like Yup, Validator.js, or implement a custom vanilla JS solution.
Benefits
- Improved user experience with clear and contextual error messages.
- Cross-browser consistency (no reliance on default browser popups).
- Easier to extend validation rules in the future.
Add ScreenShots
Priority
High
Record
- I have read the Contributing Guidelines
- Are you a GSSOC'25 contributor
- I want to work on this issue
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done