fix(frontend): add Full Name and Work Email validation in ContactSales Get Started form - #4035
fix(frontend): add Full Name and Work Email validation in ContactSales Get Started form#4035Aryanbansal-05 wants to merge 1 commit into
Conversation
…s Get Started form
|
@Aryanbansal-05 is attempting to deploy a commit to the ritesh Team on Vercel. A member of the Team first needs to authorize it. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Hi @riteshbonthalakoti! The issue has been resolved and the PR is ready to get merged. Thankyou! |
🎯 Summary
Resolves #4031 by adding client-side validation to the Full Name and Work Email fields in the ContactSales form, preventing invalid values like
a12d!orabc@afrom being submitted.🛠️ Changes Made
Frontend/src/pages/ContactSales.tsxAdded
errorsstate to track field-level validation errors.Added
validateForm()function:/^[a-zA-Z\s'\-]{2,100}$/— only letters, spaces, hyphens, apostrophes allowed/^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/— requires valid domain with TLD (e.g.john@company.com, rejectsabc@a)Updated
handleSubmit():validateForm()before submission — blocks submit if validation failsUpdated
handleChange():Added inline error messages:
✅ Fixes
a12d!rejected in Full Name field with clear error messageabc@arejected in Work Email field — requires valid TLDCloses #4031