Skip to content

Commit fec0d69

Browse files
authored
Create README.md
1 parent 930a821 commit fec0d69

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

task20-form-validation/README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Task 20 - Form Validation
2+
3+
## ✅ Objective:
4+
Build a form that validates user inputs (Name, Email, Password) in real-time before submission.
5+
6+
## 💡 Concepts Practiced:
7+
- DOM manipulation for error and success messages
8+
- Event handling with `addEventListener("submit")`
9+
- Regular expressions (Regex) for email validation
10+
- Preventing default form submission with `preventDefault()`
11+
- Responsive form design using CSS media queries
12+
13+
## 📘 What I Learned:
14+
- How to validate inputs dynamically and show user-friendly error messages.
15+
- How to apply regex to check for valid email formats.
16+
- How to use `form.reset()` after successful submission.
17+
- How to structure forms with reusable validation logic.
18+
- How to design responsive forms for mobile, tablet, and desktop.
19+
20+
## ▶️ Example Flow:
21+
1. User leaves Name empty → shows `"Name is required"` in red.
22+
2. User enters invalid Email → shows `"Enter a valid email"`.
23+
3. User enters Password shorter than 6 characters → shows `"Password must be at least 6 characters"`.
24+
4. Once all fields are valid → form resets and `"Form submitted successfully!"` is displayed in green.

0 commit comments

Comments
 (0)