HTML TUTORIALS-
-HTML Forms Tag β
Introduction-
πΉHTML Forms- Basic HTML form example for a country selection and Radio buttons , suitable for a website like learntosap.com...
β Example 1: Simple Login Form:-
<form action="/login" method="post">
<label>Username:
<input type="text" name="username" required>
</label><br>
<label>Password:
<input type="password" name="password" required>
</label><br>
<button type="submit">Login</button>
</form>
β Example 2: Registration Form:-
<form action="/register" method="post">
<label>Full Name:
<input type="text" name="fullname">
</label><br>
<label>Email:
<input type="email" name="email">
</label><br>
<label>Password:
<input type="password" name="password">
</label><br>
<label>Date of Birth:
<input type="date" name="dob">
</label><br>
<button type="submit">Register</button>
</form>
β Example 3: Feedback Form:-π
<form action="/feedback" method="post">
<label>Name:
<input type="text" name="name">
</label><br>
<label>Your Feedback:<br>
<textarea name="feedback" rows="4" cols="30"></textarea>
</label><br>
<button type="submit">Submit</button>
</form>
β Example 4: Form with Radio Buttons and Checkboxes:-π
<form action="/survey" method="post">
<p>What is your favorite color?</p>
<label><input type="radio" name="color" value="red"> Red</label>
<label><input type="radio" name="color" value="blue"> Blue</label>
<label><input type="radio" name="color" value="green"> Green</label><br>
<p>Choose your hobbies:</p>
<label><input type="checkbox" name="hobbies" value="reading"> Reading</label>
<label><input type="checkbox" name="hobbies" value="traveling"> Traveling</label>
<label><input type="checkbox" name="hobbies" value="coding"> Coding</label><br>
<button type="submit">Submit</button>
</form>
β Example 5: Form with Dropdown (Select Menu):-π
<form action="/select-country" method="post">
<label>Select your country:
<select name="country">
<option value="in">India</option>
<option value="us">USA</option>
<option value="uk">UK</option>
</select>
</label><br>
<button type="submit">Submit</button>
</form>