TGViewer
Web Development Web Development @webdevcoursefree ยท 79.6K subscribers
Post #3526 4.71K
Now, let's do one mini project based on the topics we learnt so far:

๐Ÿš€ Interactive Form with Validation

๐ŸŽฏ Project Goal
Build a signup form that:
โœ” Validates username
โœ” Validates email
โœ” Validates password
โœ” Shows success message
โœ” Prevents wrong submission

This is a real interview-level beginner project.

๐Ÿงฉ Project Structure
project/
โ”œโ”€โ”€ index.html
โ”œโ”€โ”€ style.css
โ””โ”€โ”€ script.js

๐Ÿ“ Step 1: HTML (Form UI)
<h2>Signup Form</h2>
<form id="form">
<input type="text" id="username" placeholder="Username">

<input type="text" id="email" placeholder="Email">

<input type="password" id="password" placeholder="Password">

<p id="error" style="color:red;"></p>
<p id="success" style="color:green;"></p>
<button type="submit">Register</button>
</form>
<script src="script.js"></script>

๐ŸŽจ Step 2: Basic CSS (Optional Styling)
body { font-family: Arial; padding: 40px; }
input { padding: 10px; width: 250px; display:block; margin-bottom:10px; }
button { padding: 10px 20px; cursor: pointer; }

โšก Step 3: JavaScript Logic
const form = document.getElementById("form");
const error = document.getElementById("error");
const success = document.getElementById("success");

form.addEventListener("submit", (e) => {
e.preventDefault();
const username = document.getElementById("username").value.trim();
const email = document.getElementById("email").value.trim();
const password = document.getElementById("password").value.trim();

error.textContent = "";
success.textContent = "";

if (username === "") {
error.textContent = "Username is required";
return;
}

if (!email.includes("@")) {
error.textContent = "Enter valid email";
return;
}

if (password.length < 6) {
error.textContent = "Password must be at least 6 characters";
return;
}

success.textContent = "Registration successful!";
});

โœ… What This Project Teaches
- DOM element selection
- Event handling
- Form validation logic
- UI feedback handling
- Real-world frontend workflow

โญ How to Improve (Advanced Practice)
Try adding:
โœ… Password show/hide toggle
โœ… Email regex validation
โœ… Multiple error messages
โœ… Reset form after success
โœ… Store data in localStorage

โžก๏ธ Double Tap โ™ฅ๏ธ For More
  • โค 23
  • ๐Ÿ”ฅ 2
More from @webdevcoursefree
  1. Oct 14, 2026๐ŸŒ Web Development Roadmap โ€” Part 17 HTML Images โ€” <img> Tag Images make webpages more visโ€ฆ
  2. Oct 13, 2026๐—ง๐—ข๐—ฃ ๐—™๐—ฅ๐—˜๐—˜ ๐—–๐—ข๐—จ๐—ฅ๐—ฆ๐—˜๐—ฆ ๐—ง๐—ข ๐—•๐—ข๐—ข๐—ฆ๐—ง ๐—ฌ๐—ข๐—จ๐—ฅ ๐—ฆ๐—ž๐—œ๐—Ÿ๐—Ÿ๐—ฆ ๐—œ๐—ก ๐Ÿฎ๐Ÿฌ๐Ÿฎ๐Ÿฒ! Explorโ€ฆ
  3. Oct 12, 2026For example: Go to Profile โ†’ <a> Submit Form โ†’ <button> Open Article โ†’ <a> Delete Accountโ€ฆ
  4. Oct 12, 2026๐ŸŒ Web Development Roadmap โ€” Part 16 HTML Links โ€” Tag Links are one of the most importantโ€ฆ
  5. Oct 12, 2026๐Ÿš€ ๐—ช๐—ต๐—ถ๐—ฐ๐—ต ๐—ง๐—ฒ๐—ฐ๐—ต ๐—ฆ๐—ธ๐—ถ๐—น๐—น ๐—ช๐—ถ๐—น๐—น ๐—ฌ๐—ผ๐˜‚ ๐— ๐—ฎ๐˜€๐˜๐—ฒ๐—ฟ ๐—ถ๐—ป ๐Ÿฎ๐Ÿฌ๐Ÿฎ๐Ÿฒ? Want to builโ€ฆ
  6. Oct 9, 2026Post #4079
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook โ†’Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 โ†’