(and available form fields)

Slides:



Advertisements
Similar presentations
Computer and Communication Fundamental Basic web programming Lecture 8 Rina Zviel-Girshin.
Advertisements

Technologies for web publishing Ing. Václav Freylich Lecture 4.
Supplement Creating Forms. Objectives Show how forms are used How to create the Form element HTML elements used for creating input fields.
XP 1 Creating Web Page Forms Designing a Product Registration Form Tutorial 6.
Creating Web Page Forms. Objectives Describe how Web forms can interact with a server-based program Insert a form into a Web page Create and format a.
Tutorial 6 Working with Web Forms
Forms Review. 2 Using Forms tag  Contains the form elements on a web page  Container tag tag  Configures a variety of form elements including text.
USER INTERACTIONS: FORMS
Tutorial 6 Working with Web Forms. XP Objectives Explore how Web forms interact with Web servers Create form elements Create field sets and legends Create.
Web Development & Design Foundations with XHTML Chapter 9 Key Concepts.
Chapter 10 Form Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D 1.
1 Web Developer & Design Foundations with XHTML Chapter 6 Key Concepts.
XP Tutorial 6New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Creating Web Page Forms Designing a Product Registration Form Tutorial.
1 Creating Web Forms in HTML Web forms collect information from customers Web forms include different control elements including: –Input boxes –Selection.
Forms and Form Controls Chapter What is a Form?
XHTML Introductory1 Forms Chapter 7. XHTML Introductory2 Objectives In this chapter, you will: Study elements Learn about input fields Use the element.
CSS Class 7 Add JavaScript to your page Add event handlers Validate a form Open a new window Hide and show elements Swap images Debug JavaScript.
CSC 2720 Building Web Applications HTML Forms. Introduction  HTML forms are used to collect user input.  The collected input is typically sent to a.
CpSc 462/662: Database Management Systems (DBMS) (TEXNH Approach) HTML Forms James Wang.
HTML Forms.
LOGO FORMs in HTML CHAPTER 5 Eastern Mediterranean University School of Computing and Technology Department of Information Technology ITEC229 Client-Side.
Web Development & Design Foundations with XHTML Chapter 9 Key Concepts.
Week 9 - Form Basics Key Concepts 1. 1.Describe common uses of forms on web pages 2.Create forms on web pages using the form, input, textarea, and select.
Tutorial 6 Working with Web Forms. XP Objectives Explore how Web forms interact with Web servers Create form elements Create field sets and legends Create.
Tutorial 6 Working with Web Forms. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Explore how Web forms interact with.
Creating Web Page Forms. Introducing Web Forms Web forms collect information from users Web forms include different control elements including: –Input.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 9 Key Concepts 1 Copyright © Terry Felke-Morris.
Web Development & Design Foundations with XHTML Chapter 9 Key Concepts.
HTML Forms a form is a container for input elements on a web page input elements contain data that is sent to the web server for processing.
Forms Collecting Data CSS Class 5. Forms Create a form Add text box Add labels Add check boxes and radio buttons Build a drop-down list Group drop-down.
Chapter 19 Creating and Processing HTML Forms. How HTML Forms Transmit Data name1=value1&name2=value2...&nameN =valueN GET or POST GET, an HTTP GET request,
SYST Web Technologies SYST Web Technologies XHTML Forms.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 9 Key Concepts 1 Copyright © Terry Felke-Morris.
+ FORMS HTML forms are used to pass data to a server. begins and ends a form Forms are made up of input elements Every input element has a name and value.
Tutorial 6 Working with Web Forms. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Explore how Web forms interact with.
HTML FORMS The TEXT Object Presented By: Ankit Gupta.
HTML Forms.
Week 10: HTML Forms HNDIT11062 – Web Development.
HTML III (Forms) Robin Burke ECT 270. Outline Where we are in this class Web applications HTML Forms Break Forms lab.
Lesson 5 Introduction to HTML Forms. Lesson 5 Forms A form is an area that can contain form elements. Form elements are elements that allow the user to.
HTML Structure II (Form) WEEK 2.2. Contents Table Form.
XP Tutorial 6New Perspectives on HTML, XHTML, and DHTML, Comprehensive 1 Creating Web Page Forms Designing a Product Registration Form Tutorial 6.
2440: 141 Web Site Administration Web Forms Instructor: Joseph Nattey.
XHTML Forms.
Tutorial 6 Working with Web Forms
Creating and Processing Web Forms
How to Write Web Forms By Mimi Opkins.
Introduction to HTML Forms and Servlets
Objectives Design a form Create a form Create text fields
HTML Forms Pat Morin COMP 2405.
FORMS IN HTML.
>> More on HTML Forms
FORMS Explained By: Sarbjit Kaur.
HTML IV (Forms) Robin Burke ECT 270.
ITE 115 Creating Web Page Forms
Server-Side Application and Data Management IT IS 3105 (Spring 2010)
Basic XHTML Tables XHTML tables—a frequently used feature that organizes data into rows and columns. Tables are defined with the table element. Table.
Today - Forms! WD Students produce a basic HTML/XHTML document using forms. Find the group that best matches the part of the project you are going.
ARUSHA TECHNICAL COLLEGE WEB DESIGN(html forms)
HTML/XHTML Forms 18-Sep-18.
Designing Forms Lesson 10.
Introducing Forms.
HTML Forms and User Input
Web Development & Design Foundations with H T M L 5
FORM OBJECT When creating an interactive web site for the Internet it is necessary to capture user input and process this input. Based on the result of.
Forms, cont’d.
CNIT 131 HTML5 - Forms.
Web Development & Design Foundations with H T M L 5
Unit 5 Create Forms.
Presentation transcript:

(and available form fields) Creating Forms (and available form fields)

Forms on the Web The majority of forms on the web are HTML forms. Other forms are used part of web applications such as: Flash Applications PDFs Web Services .NET Applications

HTML Forms All HTML forms must: Be enclosed in form tags Have one or more inputs Have a submit button

The <form> Tag The basic block of a form is the <form> tag which defines the area of form. Only controls and attributes within the area defined by the form element will be processed or passed to a script. HTML form is a section of a document containing normal content, markup, special elements called “controls”.

Form Tag Attributes Syntax for form tags: Required Elements: action <form action=“process.asp" method="post"> Required Elements: action This defines what will happen when the form is submitted. Method get post

Get Method Used to pass information collected by the form via the url. Most useful: For short strings, When you want the information visible to the user, Or to allow the form information to be bookmarked for later use without filling the form out again. Don’t use: For sensitive information like userid and password, Lots of information being passed by the form.

Post Method Post Method hides the form field information when it is transferred to the page or application that will be processing the form. Most useful: For information you don’t want displayed, Passing longer form responses Don’t use: If you want people to be able to save the form information, Need real security for the form results. If you need real security on the form results you must use an https connection that will encrypt all information exchanged between the server and the browser.

The following types of controls are available within a form: Control Types The following types of controls are available within a form: Text Textarea Password Checkboxes Radio Buttons Select Boxes Buttons Image Hidden Input File Select Object controls

Elements of a Control Required attributes of a control: Type Name Optional attributes of a control: value checked disabled readonly size maxlength id src alt tabindex accesskey usemap ismap onfocus onselect onchange accept onblur onclick onmousedown onmouseup onmouseover onmouseout onkeypress onkeydown onkeyup

Text Is probably the most commonly used form control. Syntax: <input type=“text” name=“email”> Options frequently used: ID – for style or script reference Size – set width Maxlength – maximum number of characters for the form field

Password Password is a type of textbox where the form field entry is hidden by asterisks. <input type="password" name=“comment" /> Commonly uses the same attributes as a text field. Less commonly used in both control types: tabindex accesskey event triggers by key or mouse action

Textarea This control has a different syntax than the two other text input types. <textarea name="textfield2"></textarea> Commonly used attributes: cols – width of form field rows – number of rows displayed Optional attributes specific to this control: wrap – default is virtual Virtual Off Physical

Radio Buttons When you want the user to make only one choice from a fixed set of option. <label>Radio Buttons:<input name="computerOwner" type="radio" value="yes" />I own a computer </label> For multiple options make sure that the name element is the same for all items in the group. name="computerOwner”

Checkboxes Use when you want to offer non-exclusive options. <input type="checkbox" name="checkbox" value=“0-5" /> Required attribute: value Control specific attribute “checked” to set the default state of the checkbox: <label><input name="computers" type="checkbox" value="1-5" checked="checked" />1-5</label>

Good Practice Tip When using a control that has multiple separate fields such as checkboxes and radio button use “fieldset” and legend to create a logical group. Computers in Household: 0-5 6-11 12-25 25-50 <fieldset> <legend>Computers in Household: </legend> <label><input type="checkbox" name="computers" value="0-5" />0-5</label> <label><input type="checkbox" name="computers1" value="6-11" />6-11</label> <label><input type="checkbox" name="computers2" value="12-25" />12-25</label> <label><input type="checkbox" name="computers3" value="25-50" />25-50</label> </ fieldset>

Select Box A select box offers multiple options within one form control. Can be either: Menu – displayed as a drop down box <select name="skill"> <option value="0" selected="selected">--select--</option> List – set a multiple line display with the number of the items to chose from displayed <label>Skill Level<br /> <select name="skill1" size="6">

Option Group Within a select box you can group choices together with a non-selectable option such as: <label for="favcity">Which is your favorite city?</label> <select id="favcity" name="favcity"> <optgroup label="North America"> <option value="5">New York</option> <option value="6">Houston</option> <option value="7">Montreal</option> </optgroup> <optgroup label=“Central America"> <option value="10">Cozamel</option> <option value="11">Belize</option> <option value="12">Panama</option> <optgroup label="South America"> <option value="8">Buenos Aires</option> <option value="9">Portillo</option> </select>

Image Creates a graphical submit button. The value of the src attribute specifies the URI of the image that will decorate the button. For accessibility reasons, authors should provide alternate text for the image via the alt attribute. <input name="imageField" type="image" src="register.gif" width="72" height="20" border="0" alt="register" />

Hidden Use this control type to store information between client/server exchanges that would otherwise be lost due to the stateless nature of HTTP Common example might be to pass an item number or other identifier such as: <input name="sku" type="hidden" value="P-457" />

File Select File Select This control type allows the user to select files so that their contents may be submitted with a form. <label for="file">Select File</label> <input type="file" name="file" id="file" /> Note: using this control will not cause the file selected to be uploaded.

Object The object control is used to create custom controls and is beyond the scope of this presentation

Accessibility There are some attributes that are designed with accessibility in mind but also benefit usability: Tabindex – specifies the order the cursor or focus moves from one field to the next. If it isn’t specified the order maybe different depending on browser and OS. Accesskey – while a recommendation of the W3C because of conflicts with operating system shortcuts, browser and program specific shortcut assignments it is difficult to find combinations that do not conflict. If you use them make sure you have a visible legend.

Resources For more information on forms check: W3C Form http://www.w3.org/TR/REC-html40/interact/forms.html#form-controls WebAim – Creating Accessible Forms http://www.webaim.org/techniques/forms/