HTML Forms and Frames

Содержание

Слайд 2

Table of Contents

HTML Forms
Form Fields and Fieldsets
Text Boxes
Buttons
Checkboxes and Radio Buttons
Select Fields
Hidden

Table of Contents HTML Forms Form Fields and Fieldsets Text Boxes Buttons
Fields
Sliders and Spinboxes
Validation Fields

Слайд 3

Table of Contents

HTML Frames
Frame and noframe tags
iframe tag

Table of Contents HTML Frames Frame and noframe tags iframe tag

Слайд 4

HTML Forms

Entering User Data from a Web Page

HTML Forms Entering User Data from a Web Page

Слайд 5

What are HTML Forms?

The primary method for gathering data from site visitors
HTML

What are HTML Forms? The primary method for gathering data from site
Forms can contain
Text fields for the user to type
Buttons for interactions like "Register", "Login", "Search"
Menus, Sliders, etc…
Check Google, Yahoo, Facebook
Google search field is a simple Text field

Слайд 6

How to Create a HTML Form?

Create a form block with
Example:


How to Create a HTML Form? Create a form block with Example:
action="path/to/some-script.php">
...

The "action" attribute tells where the form data should be sent

The "method" attribute tells how the form data should be sent – via GET or POST request

Слайд 7

Text Fields

Single-line text input fields:
Multi-line text input fields (textarea):
Password input – a

Text Fields Single-line text input fields: Multi-line text input fields (textarea): Password
text field which masks the entered text with * signs




Слайд 8

Buttons

Reset button – brings the form to its initial state
Submit button:
Image button

Buttons Reset button – brings the form to its initial state Submit
– acts like submit but image is displayed and click coordinates are sent
Ordinary button – no default action, used with JS

value="Reset the form" />

name="submitBtn" alt="Submit" />



Слайд 9

Checkboxes and Radio Buttons

Checkboxes:
Radio buttons:
Radio buttons can be grouped, allowing only one

Checkboxes and Radio Buttons Checkboxes: Radio buttons: Radio buttons can be grouped,
to be selected from a group:





Слайд 10

Select Fields

Dropdown menus:
Multiple-choice menus



Слайд 11

Hidden Fields

Hidden fields contain invisible data
Not shown to the user
Used by JavaScript

Hidden Fields Hidden fields contain invisible data Not shown to the user
and server-side code
ViewState, SessionState in ASP.NET

value="This is a hidden text field" />

Слайд 12

Labels

Labels are used to associate an explanatory text to a form field

Labels Labels are used to associate an explanatory text to a form
using the field's ID
Clicking on a label focuses its associated field
Checkboxes are toggled
Radio buttons are checked
Labels are
Both a usability and accessibility feature
Required in to pass accessibility validation



Слайд 13

Fieldsets

Fieldsets are used to enclose a group of related form fields:
The

Fieldsets Fieldsets are used to enclose a group of related form fields:
is the fieldset's title



Client Details




Order Details




Слайд 14

IE8
Safari

IE8 Safari

Слайд 15

HTML Forms Inputs Fields

Live Demo

HTML Forms Inputs Fields Live Demo

Слайд 16

Sliders and Spinboxes

Live Demo

Sliders and Spinboxes Live Demo

Слайд 17

Range and Spinbox

Restricts users to enter only numbers
Additional attributes min, max and

Range and Spinbox Restricts users to enter only numbers Additional attributes min,
step and value
Can become Spinbox or Slider, depending on the input type
Have some differences on different browsers
Sliders and Spinboxes do not work on Firefox
Shown as regular textboxes



Слайд 18

Field Attributes from HTML 5

Autocomplete
The browser stores the previously typed values
Brings them

Field Attributes from HTML 5 Autocomplete The browser stores the previously typed
back on a later visit
Autofocus
The field becomes on focus on page load
Required
The field is required to be filled/selected

autofocus="autofocus" />

Слайд 19

Input Fields with Validation

Email – provides a simple validation for email
Can be

Input Fields with Validation Email – provides a simple validation for email
passed a pattern for validation
In a mobile device brings the email keyboard
URL – has validation for url
In a mobile device brings the url keyboard
Telephone
Brings the numeric keyboard




Слайд 20

Tab Index

Live Demo

Tab Index Live Demo

Слайд 21

Tab Index

The tabindex HTML attribute controls the order in which form fields

Tab Index The tabindex HTML attribute controls the order in which form
and hyperlinks are focused when repeatedly pressing the TAB key
tabindex="0" (zero) – "natural" order
If X < Y, then elements with tabindex="X" are iterated before elements with tabindex="Y"
Elements with negative tabindex are skipped, however, this is not defined in the standard



Слайд 22

HTML Frames

, and

Слайд 27

Homework (1)

Create a Web form that looks like this sample:

Homework (1) Create a Web form that looks like this sample:

Слайд 28

Homework (2)

Create the following using tables and forms:

Homework (2) Create the following using tables and forms:

Слайд 29

Homework (3)

Construct the following Grid component:
Try to make a HTML page, that

Homework (3) Construct the following Grid component: Try to make a HTML
looks just like the example
Имя файла: HTML-Forms-and-Frames.pptx
Количество просмотров: 23
Количество скачиваний: 0