Making Forms in HTML

  • Post author:

The <form> tag is used to add HTML forms to the web page for user input. Forms are used to pass the data submitted by the user to the server.

The data is sent when pressing the “Submit” button. If there isn’t such button, the information is sent when the “Enter” key is pressed.

The <input> tag defines a user input field.
The <textarea> tag defines a form field to create a multiline input area.
The <button> tag is used to place a button inside a form.

The <select> tag sets up a control for creating a drop-down list box.

The <option> tag defines the items in the drop-down list set by the <select> tag.

The <optgroup> tag groups related data in the drop-down list set by the <select> tag.

The <fieldset> tag visually groups the elements inside the form set by the <form> tag.

The <label> tag sets the text label for the <input> element.

The <legend> tag defines the header for the <fieldset> element.


Source Code For Forms in HTML

<!DOCTYPE html>



      <title>16 Akash Jha</title>


                <body style=”background-color:rgb(71, 255, 224)”>

<h2 >Form: Expt 4</h2><br>

<form  style=”font-size:large;” method=”GET”>

                Name: <input type=”text” required id=”txtName” placeholder=”Enter Your Name”><br></br>

                Phone Number: <input type=”number” required id=”number” placeholder=”Enter Your Mobile Number”><br></br>

                Password: <input type=”password” required id=”password” placeholder=”Enter the password”><br></br>

                City: <input type=”text” id=”txtcity” value=”Mumbai” selected><br></br>

<br></br> <b>Gender: </b><br>

<input type=”radio” id=”male” name=”gender” value=”Male”> Male<br></br>

<input type=”radio” id=”female” name=”gender” value=”female”> Female<br></br>

<input type=”radio” id=”others” name=”gender” value=”Others”> Others<br></br>

<b>Interested in: </b><br>

<small>(Select atleast 2)</small><br>

<input type=”checkbox” value=”HTML” > HTML<br><br>

<input type=”checkbox” value=”CSS” > CSS<br><br>

<input type=”checkbox” value=”JS” > JavaScript<br><br>

<input type=”checkbox” value=”JQuery” > JQuery<br><br>

<input type=”checkbox” value=”PHP” > PHP<br><br>

<input type=”submit” value=”Send”>




I hope you liked the content of FORMS in HTML

Follow Me On Instagram : the_aakash_sky

Read Our Technical Research Papers Click Me

Basics of HTML part 3: Click Here


This Post Has One Comment

Leave a Reply