How to make FORMS in HTML

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>
fig no 1

2. Types and attributes

TypeDescription
<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
fig 1: HTML types

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>
fig 2 : output of input element

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>
fig no 3:

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>
fig no 4

THANKYOU ALL #behappy #havefun #happycoding #workhard SEE YOU in next article . and yes any doubt please do comment . πŸ™‚

You may also like...

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: