0% found this document useful (0 votes)
3 views

HTML Forms

This document provides an overview of creating forms using HTML tags, detailing the purpose of HTML forms for collecting user input and sending it to a server. It explains various form attributes, including the method (GET and POST) and action attributes, as well as different input types such as text, password, radio, checkbox, and more. Additionally, it covers the creation of dropdown lists using the <select> element and multi-line text inputs using the <textarea> tag.

Uploaded by

3385
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

HTML Forms

This document provides an overview of creating forms using HTML tags, detailing the purpose of HTML forms for collecting user input and sending it to a server. It explains various form attributes, including the method (GET and POST) and action attributes, as well as different input types such as text, password, radio, checkbox, and more. Additionally, it covers the creation of dropdown lists using the <select> element and multi-line text inputs using the <textarea> tag.

Uploaded by

3385
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

HTML TAGS


Learning Objective

Creating FORMS using HTML tags.
FORMS IN HTML

WATCH VIDEO
https://www.youtube.com/watch?v=vUXD6zEcuwI
Identify the form elements

FORMS IN HTML
 An HTML form is used to collect user input. The user input can then be
sent to a server for processing.

Form Attributes
 The HTML <form> method Attribute is used to specify the HTTP method used to
send data while submitting the form. There are two kinds of HTTP methods,
which are GET and POST.
 GET is better for the data which does not require any security or having images or
word documents.
 POST is used to send data to a server to create/update a resource in a secure
way.
 Action Attribute is used to specify where the form data is to be sent to the server
after submission of the form. Attribute Values: URL: It is used to specify the URL
of the document where the data to be sent after the submission of the form.
EX: <form action="/action_page.php" method="get">
<INPUT>
Here are the different input types you can use in
HTML:
<input type="text">
<input type="password">
<input type="radio">
<input type="checkbox">
<input type="reset">
<input type="submit">
<input type="button">
Attributes are: name, value
<INPUT>
 <input type="text" name=“n1“ value=“Enter your name”>

<input type="password" name="pwd">

GENDER<input type="radio" name="g1" value="female">FEMALE


<input type="radio" name="g1" value=“male">MALE

Hobbies:<input type="checkbox" name="c1" value="chess">Play chess


<input type="checkbox" name="c2" value="book">Reading book
<INPUT>
Here are the different input types you can use in HTML:

<input type="submit" name="s1" value="CLICK">

<input type="image" src="img_submit.gif" alt="Submit"


width=“50" height=“50">

<button type="button" onclick=“alert('submit the data')">Click me

<input type="reset">
TEXT AREA,COMBO BOX

How to add a text area?


How to add a combo box/drop down list?
Drop down list/Combo box
The <select> element is used to create a drop-
down list.

The <option> tags inside


the <select> element define the available
options in the drop-down list.

Attributes are: size, multiple , name ,


disabled
Drop down list
<select name="favcolor">
<option>GREEN</option>
<option>BLUE</option>
<option>YELLOW</option>
<option>ORANGE</option>
</select>
<select name="favcolor“ size=“3”>
Text area
The <textarea> tag defines a multi-line
text input control.
A text area can hold an unlimited number
of characters.
The size of a text area can be specified by
the cols and rows attributes.
Text area
<textarea name="t1" rows="4" cols="50">
Enter the address here
</textarea>
TASK SHEET

THANK YOU !!!

You might also like