HTML Forms - Web Programming - Lecture Slides, Slides of Computer Programming

If you are looking for Web Programming course, you are at right place. This lecture key words are: Html Forms, Purpose of Forms, Posting, History of Forms, Important Elements, Input Element, Label Element, Buttons, Html5 Form Improvements

Typology: Slides

2012/2013

Uploaded on 09/27/2013

vikrant
vikrant 🇮🇳

4.4

(9)

119 documents

1 / 23

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
HTML Forms
docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17

Partial preview of the text

Download HTML Forms - Web Programming - Lecture Slides and more Slides Computer Programming in PDF only on Docsity!

HTML Forms

The Purpose of Forms

 Forms are used to create boxes and other controls that allow users to enter data  The data is typically submitted to the server for processing  We will get to server-side processing in a week or two  JavaScript can be used to access form elements on the client

History of Forms

 They have been the same “forever”  XFforms tried and failed

 Big changes in HTML 5  But they don‟t break existing code  Not all browsers support all features

Important Elements (tags)

 The **** element marks a region used to get user input  It is the form that is posted to the server  The **** element groups visible elements in the form  The **** element draws a prompt around the **** box

The Element

 The action attribute contains the URL where the data will be posted to the server  This makes little sense now but will when we talk about server-side processing  The method attribute defines how the form is posted  get – data is posted the „query string‟  put – data is posted in the form header  Note that name attributes deprecated (use id)

The Element

(Example)

 A first form with two text boxes:

** First name:
Last name:

**

The Element (2)

 The **** element contains text that appears in the border  It must appear as an immediate child of


 It‟s required with XHTML strict

The element

 It‟s a visible label that the user sees  Use it to create prompts  Set the for attribute to the id property of the related control

text Elements

text elements allow the users to enter text into a text box  password elements hides the characters entered  The value attribute stores the entered value  Example  ****

checkbox

Elements

 It‟s a box that can be checked or unchecked (a two-state control)

Elements

 Use to select items from a drop-down list  The child **

HTML5 Form Improvements

 HTML5 introduces some new controls and extends existing ones  ****  There are several extensions (w3schools)  The placeholder attribute displays default text  If the required attribute is set, the form cannot be submitted until the user provides input

HTML5 Form Improvements

 ****  There are several extensions (w3schools)  The placeholder attribute displays default text  If the required attribute is set, the form cannot be submitted until the user provides input  The required and optional attributes are used with CSS styles attribute is set