How to make FORMS in HTML

HELLO FRIENDS!!!!
βThe bad news is time flies. The good news is youβre the pilot.β
TODAY we will see how to make form in html
lets start π
1. This is the basic html code for making forms
<!DOCTYPE html>
<html>
<body>
<h3> Forms in HTML </h3>
<label for="fname">First name:</label><br>
<input type="text" id="fname" name="fname" value="abced"><br>
<label for="lname">Last name:</label><br>
<input type="text" id="lname" name="lname" value="wxyz"><br><br>
<input type="submit" value="Submit">
</form>
</body>
</html>

2. Types and attributes
Type | Description |
---|---|
<input type=”text”> | Displays a single-line text input field |
<input type=”radio”> | Displays a radio button (for selecting one of many choices) |
<input type=”checkbox”> | Displays a checkbox (for selecting zero or more of many choices) |
<input type=”submit”> | Displays a submit button (for submitting the form) |
<input type=”button”> | Displays a clickable button |
3 How to input the element
<!DOCTYPE html>
<html>
<body>
<h2>INPUT ELEMENT</h2>
<label for="fname">First name:</label><br>
<input type="text" id="fname" name="fname"><br><br>
<input type="submit" value="Submit">
</form>
</body>
</html>

4. Drop down list in HTML FORM
β<!DOCTYPE html>
<html>
<body>
<h2>drop-down list</h2>
<label for="state">Choose a state:</label>
<select id="state" name="state">
<option value=>Maharashtra</option>
<option value=>Arunachal Pradesh</option>
<option value=>Tamil Nadu</option>
<option value=>Tripura</option>
</select>
<input type="submit">
</form>
</body>
</html>

5.How to make text area.
<!DOCTYPE html>
<html>
<body>
<h2>Textarea</h2>
<textarea name="message" rows="5" cols="25">hello plzz write.</textarea>
<br><br>
<input type="submit">
</form>
</body>
</html>

THANKYOU ALL #behappy #havefun #happycoding #workhard SEE YOU in next article . and yes any doubt please do comment . π
You must be logged in to post a comment.