feat: add client-side validation to contact form (#188) #192
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.
addressing issue #188.
What’s Included:
Validates the following fields:
Full Name: must not be empty
Email: must not be empty and must be in valid format
Phone: must not be empty and should have at least 10 digits
Message: must not be empty
Displays specific error messages next to each field
Prevents form submission until all fields are valid
Clears a field’s error message as soon as the user begins correcting it
This update improves user experience and ensures valid data is submitted to the backend.
Fixes: #188
Type of change
New feature — non-breaking change that adds validation functionality to an existing form.
Test Configuration
Firmware version: Not applicable
Hardware: Tested locally on macOS
Toolchain: Node.js, Next.js
SDK: Web3Forms
Checklist
Code follows the style guidelines of this project
Performed self-review and tested in the browser
Errors clear in real-time and form blocks invalid submission
No new warnings or breaking changes
No changes required in documentation
No additional dependencies introduced