Professional Documents
Culture Documents
Topic 2.5 Form
Topic 2.5 Form
2
Forms Tools
The <form> Element
3
Forms Tools
The <form> Element
The HTML <form> Elements
The HTML <form> element can contain one or more of the
following form elements:
<input>
<label>
<form> <select>
. <textarea>
<button>
form elements <fieldset>
. <legend>
</form> <datalist>
<output>
<option>
<optgroup>
4
Forms Tools
The <input> Element
5
Forms Tools
Textbox
6
Forms Tools
Textbox
7
Activity 2.14 : Textbox
8
Forms Tools
Radio button
✓<input type="radio"> defines a radio button. Radio buttons let a user select
ONLY ONE of a limited number of choices.
9
Forms Tools
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
list.
10
Forms Tools
Check Box
✓ <input type="checkbox"> defines a checkbox. Checkboxes let a user select
ZERO or MORE options of a limited number of choices.
11
Forms Tools
Textarea
✓ The <textarea> tag defines a
multi-line text input control.
✓ A text area can hold an
unlimited number of
characters, and the text
renders in a fixed-width font
(usually Courier).
✓ The size of a text area can
be specified by the cols and
rows attributes, or even
better; through CSS' height
and width properties.
12
Activity 2.14 : Textarea
13
Forms Tools
Button
• Two button elements that act as one submit button and one reset
button (in a form):
• Syntax:
button type="button|submit|reset">
Value Description
button The button is a clickable button
submit The button is a submit button (submits
form-data)
reset The button is a reset button (resets the
form-data to its initial values) 14
Forms Tools
Submit Button
✓ <input type="submit">
defines a submit button.
✓ A submit button is used to
send form data to a server.
The data is sent to the page
specified in the form's
action attribute.
15
Forms Tools
Submit and Reset Button
✓ <input type=“reset">
defines a reset button.
✓ Used to clear form and
start over.
16
Forms Tools
File upload
The accept attribute specifies
the types of files that the
server accepts (that can be
submitted through a file
upload).
Note: The accept attribute
can only be used with <input
type="file">.
17
Forms Tools
Hidden Textfield
18
Forms Tools
Hidden Textfield
19
Forms Tools
20
Activity 2.15 : HTML Forms
21
22