Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
HTML - FORMS.pptx
1. HTML FORMS ARE REQUIRED WHEN YOU WANT TO COLLECT
SOME DATA FROM THE SITE VISITOR. FOR EXAMPLE
DURING USER REGISTRATION YOU WOULD LIKE TO COLLECT
INFORMATION SUCH AS NAME, EMAIL ADDRESS, CREDIT CARD,
ETC.
A FORM WILL TAKE INPUT FROM THE SITE VISITOR AND THEN
WILL POST IT TO A BACK-END APPLICATION SUCH AS CGI, ASP
SCRIPT OR PHP SCRIPT ETC. THE BACK-END APPLICATION WILL
PERFORM REQUIRED PROCESSING ON THE PASSED DATA BASED
ON DEFINED BUSINESS LOGIC INSIDE THE APPLICATION.
THERE ARE VARIOUS FORM ELEMENTS AVAILABLE LIKE TEXT
FIELDS, TEXTAREA FIELDS, DROP-DOWN MENUS, RADIO
BUTTONS, CHECKBOXES, ETC.
HTML Forms
2. HTML FORM CONTROLS
There are different types of form controls that you can use to collect data
using HTML form:
Text Input Controls
Checkboxes Controls
Radio Box Controls
Select Box Controls
3. TEXT INPUT CONTROLS
There are three types of text input used on forms:
Single-line text input controls –
This control is used for items that require only one line ofuser input, such as search
boxes or names. They are created using HTML <input> tag.
Password input controls –
This is also a single-line text input but it masks the character as
soon as a user enters it. They are also created using HTML <input> tag.
Multi-line text input controls –
This is used when the user is required to give details that may be longer than a single
sentence. Multi-line input controls are created using HTML <textarea> tag.
4. SINGLE-LINE TEXT INPUT CONTROLS
This control is used for items that
require only one line of user input,
such as search boxes or names.
They are created using HTML
<input> tag.
<html>
<head>
<title>Text Input Control</title>
</head>
<body>
<form >
First name: <input type="text"
name="first_name" />
<br>
Last name: <input type="text"
name="last_name" />
</form>
</body>
</html>
5. Sr.No Attribute & Description
1 type
Indicates the type of input control and for text input control it will be set to text.
2 name
Used to give a name to the control which is sent to the server to be recognized and get the value.
3 value
This can be used to provide an initial value inside the control.
4 size
Allows to specify the width of the text-input control in terms of characters.
5 maxlength
Allows to specify the maximum number of characters a user can enter into the text box.
Attributes
Following is the list of attributes for <input> tag for creating text field.
The NAME, VALUE, SIZE, and MAXLENGTH attributes are optional
6. PRACTICE
<form>
First Name: <INPUT TYPE="text"
NAME="FirstName" VALUE="First
Name" SIZE=20>
<BR><BR>
Last Name: <INPUT TYPE="text"
NAME="LastName" SIZE=10>
</form>
8. MULTIPLE-LINE TEXT INPUT CONTROLS
This is used when the user is required to give details that may be
longer than a single sentence. Multi-line input controls are created
using HTML <textarea> tag.
To create larger text areas, type <TEXTAREA NAME=“name” ROWS=n1
COLS=n2 WRAP> Default Text </TEXTAREA>,
where n1 is the height of the text box in rows and n2 is the width of
the text box in characters
The WRAP attribute causes the cursor to move automatically to the
next line as the user types
9. Sr.No Attribute & Description
1 name
Used to give a name to the control which is sent to the server to be
recognized and get the value.
2 rows
Indicates the number of rows of text area box.
3 cols
Indicates the number of columns of text area box
Attributes
Following is the list of attributes for <textarea> tag.
11. CHECKBOX CONTROL
Checkboxes are used when more than one option is required to be selected.
They are also created using HTML <input> tag but type attribute is set to checkbox..
One thing this control has in particular is that, even when it can be declared as part of a thematic group, each checkbox
is independent from all other checkboxes in the form.
To create a checkbox, type <INPUT TYPE=“checkbox” NAME=“name” VALUE=“value”>Label
Attributes -
type
Indicates the type of input control and for checkbox input control it will be set to checkbox..
name
Used to give a name to the control which is sent to the server to be recognized and get the value.
value
The value that will be used if the checkbox is selected.
checked
Set to checked if you want to select it by default.
12. RADIO BUTTON CONTROL
Radio buttons are used when out of many options, just one option is required
to be selected. They are also created using HTML <input> tag but type
attribute is set to radio.
While checkboxes are independent and can be declared on their own, radio
buttons are options that need to be grouped in order to have a meaning.
when you select one option, the previous selected option gets deselected
To create a radio button, type <INPUT TYPE=“radio” NAME=“name”
VALUE=“data”>Label
where “data” is the text that will be sent to the server if the button is checked
and “Label” is the text that identifies the button to the user
13. Sr.No Attribute & Description
1
type
Indicates the type of input control and for checkbox input control it
will be set to radio.
2
name
Used to give a name to the control which is sent to the server to be
recognized and get the value.
3
value
The value that will be used if the radio box is selected.
4
checked
Set to checked if you want to select it by default.
Attributes
Following is the list of attributes for radio button.
14. SELECT BOX CONTROL
A select box, also called drop down box which provides option to list
down various options in the form of drop down list, from where a user can
select one or more options.
To create a drop-down menu, type <SELECT NAME=“name” SIZE=n
MULTIPLE>
Then type <OPTION VALUE= “value”>Label
In this case the SIZE attribute specifies the height of the menu in lines and
MULTIPLE allows users to select more than one menu option
15. Sr.No Attribute & Description
1 name
Used to give a name to the control which is sent to the server to be
recognized and get the value.
2 size
This can be used to present a scrolling list box.
3 multiple
If set to "multiple" then allows a user to select multiple items from the
menu.
Attributes
Following is the list of important attributes of <select> tag −
16. LISTS WITH MULTIPLE ATTRIBUTE
When the multiple attribute is present
<form>
<p> Select categories:<br>
<select multiple >
<option value="art">Art and entertainment</option>
<option value="tv">Television and movies</option>
<option value="kids">Kids and teenagers</option>
<option value="diy">Do it yourself</option>
</select>
</p>
</form>
17. AUDIO & VIDEO IN HTML
For inserting a video file –
<video width="320" height="240" autoplay>
<source src="movie.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
<audio controls>
<source src="horse.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
<a href = quiz.htm>form1</a>
<a href =mailto:xyz@yahoo.com>contact us</a>
<a href = quiz.htm><img src =panda.jpg width = 50 height = 30></a>
<body background=panda.jpg>
18. PRACTICE
<input type = "checkbox" name = "maths" value = "on"> Maths
<input type = "checkbox" name = "physics" value = "on"> Physics
<input type = "checkbox" name = “Biology" value = "on"> Biology
<input type = "checkbox" name = “Comp Application" value = "on"> Comp Application
<BR> <BR>
<input type = "radio" name = "subject" value = "maths"> Mathematics
<input type = "radio" name = "subject" value = "phy"> Physics
<BR><BR>
<select name = "dropdown">
<option value = "Maths" selected>Maths</option>
<option value = "Physics">Physics</option>
<option value = “Biology"> Biology </option>
<option value = “Comp Application"> Comp Application </option>
</select>
<p> Select categories:<br>
<select multiple >
<option value="art">Art and entertainment</option>
<option value="tv">Television and movies</option>
<option value="kids">Kids and teenagers</option>
<option value="diy">Do it yourself</option>
</select>
</p>