Contact Form
React.js
easy
Create a Contact Form Component that allows users to enter their name, email, and a message, and submit the form. Display a confirmation message after a successful submission.
Requirements
- The form must contain three fields:
name
,email
, andmessage
. - All fields are required.
- The email field must be validated to ensure proper format.
- On submission, show a "Thank you" message with the entered name.
- Prevent submission if validation fails. And show message 'Name is required', ' Email is required', 'Message is required'
Constraints & Edge Cases
- Constraint 1: Name, email, and message are mandatory fields.
- Constraint 2: Email must be in valid format.
- Edge Case 1: User submits without filling fields → show error.
- Edge Case 2: User enters invalid email → show specific email error.
- Edge Case 3: After successful submission, fields should reset.
Reference UI
Preview what you need to build
Companies:
meta
google
paytm
Solve Similar questions 🔥