Professional Documents
Culture Documents
It8078 Web Design and Management
It8078 Web Design and Management
1
FORMS AND HTML5
Form basics
Objectives
2
FORM BASICS – WEB DATA
3
HTML FORMS
HTML Forms are required when you want to collect some data from the
site visitor.
For example registration information: name, email address, credit card,
etc. Form elements are like text fields, textarea fields, drop-down
menus, radio buttons, checkboxes, etc. which are used to take
information from the user.
4
HTML FORMS
form: a group of UI controls that accepts information from the user and
sends the information to a web server
the information is sent to the server as a query string
5
FORM ATTRIBUTES
6
HTML FORM: <FORM>
Required action attribute gives the URL of the page that will process this form's
data
When form has been filled out and submitted, its data will be sent to the
action's URL
7
FORM EXAMPLE
<form action="http://www.google.com/search">
<div>
Let's search Google:
<input name="q" />
<input type="submit" />
</div>
</form>
First Paragraph
8
FORM CONTROLS: <INPUT>
9
FORM CONTROLS: <INPUT> (CONT.)
type can be button, checkbox, file, hidden, password, radio, reset, submit, text,
...
value attribute specifies control's initial text
10
TEXT FIELDS: <INPUT>
11
TEXT BOXES: <TEXTAREA>
12
CHECK BOXES: <INPUT>
13
RADIO BUTTONS: <INPUT>
14
TEXT LABELS: <LABEL>
associates nearby text with control, so you can click text to activate control
can be used with checkboxes or radio buttons
label element can be targeted by CSS style rules
15
DROP DOWN LISTS: <SELECT>, <OPTION>
<select name="favoritecharacter">
<option>Frodo</option>
<option>Bilbo</option>
<option selected="selected">Gandalf</option>
<option>Galandriel</option>
</select>
16
USING: <SELECT> FOR LISTS
optional multiple attribute allows selecting multiple items with shift- or ctrl-click
must declare parameter's name with [] if you allow multiple selections
option tags can be set to be initially selected
17
OPTION GROUPS: <OPTGROUP>
<select name="favoritecharacter">
<optgroup label="Major Characters">
<option>Frodo</option>
<option>Sam</option>
<option>Gandalf</option>
<option>Aragorn</option>
</optgroup>
<optgroup label="Minor Characters">
<option>Galandriel</option>
<option>Bilbo</option>
</optgroup>
</select>
18
COMPLETE EXAMPLE
19
HTML5 - INTRODUCTION
20
BROWSER SUPPORT FOR HTML5
HTML5 is not yet an official standard, and no browsers have full HTML5
support.
But all major browsers (Safari, Chrome, Firefox, Opera, Internet Explorer)
continue to add new HTML5 features to their latest versions.
21
MINIMUM HTML5 DOCUMENT
22
HTML5 NEW ELEMENTS
23
THE NEW <CANVAS> ELEMENT
The <canvas> element is used to draw graphics, on the fly, via scripting (usually
JavaScript).
24
NEW MEDIA ELEMENTS
25
NEW SEMANTIC/STRUCTURAL ELEMENTS
26
NEW SEMANTIC/STRUCTURAL ELEMENTS
27
NEW SEMANTIC/STRUCTURAL ELEMENTS
28
REMOVED ELEMENTS
29
HTML5 CANVAS
30
HTML5 INLINE SVG
31
SVG ADVANTAGES
32
SVG VS CANVAS
33
HTML5 GEOLOCATION
34
HTML5 GEOLOCATION API
35
HTML5 VIDEO
36
HTML5 AUDIO
37
NEW FORM ELEMENTS, ATTRIBUTES & TYPES
38
INTRODUCTION
HTML5 web forms introduced new form elements, input types, attributes ,and
other features.
Many features using in our interfaces: form validation, combo boxes,
placeholder text, and the like.
Marking up forms easier on the developer, also better for the user.
39
EVALUATION
Forms section of HTML5 was titled Web Forms 2.0 that added new types for
forms.
Started by Opera and edited by Opera employee Ian Hickson, was submitted
to theW3C in early 2005.
Combined with Web Applications 1.0 to create the basis of Web Hypertext
Application TechnologyWorking Group (WHATWG) HTML5 specification.
40
HTML5 FORMS
41
CRITERIA
42
NEW FORM ELEMENT
43
NEW FORM ELEMENT <DATALIST>
44
NEW FORM ELEMENT <KEYGEN>
The <keygen> Defines a key-pair key-pair generator field used for forms.
When the form submitted, the private key is stored locally, and the public key is
sent to the server.
The purpose of the <keygen> element is to provide a secure way to
authenticate users.
45
NEW FORM ELEMENT <OUTPUT>
46
ATTRIBUTES OF THE <DATALIST> ELEMENT
47
ATTRIBUTES OF THE <DATALIST> ELEMENT
Example
48
ATTRIBUTES OF <KEYGEN> ELEMENT
Example
49
ATTRIBUTES OF <KEYGEN> ELEMENT
Example
50
ATTRIBUTES OF THE <OUTPUT> ELEMENT
Example
51
ATTRIBUTES OF THE <OUTPUT> ELEMENT
Example
52
HTML5 FORMS
53
TYPES OF THE <INPUT> ELEMENT
HTML5 gives us input types that provide for more data-specific UI elements and
native data validation. HTML5 has a total of 13 new input types:
54
INPUT EXAMPLE
55
INPUT EXAMPLE - VALIDATION
56
NEW ATTRIBUTES
57
PATTERN – HTML5PATTERN.COM
58
SUMMARY
HTML5 is still work in progress and not due to completely roll out until
the latter part of 2011.
There is no urgency to redesign a Web site using the new iteration of
the language.
Only a handful of major brands, including Mozilla Firefox and Google
Chrome, currently support HTML5 elements.
Those companies’ browsers are only a small fraction of the browsing
populations.
Microsoft’s Internet Explorer is the most widely used browser and
currently has the least amount of support for HTML5.
59
SELF-CHECK EXERCISE
60