2440: 141 Web Site Administration Web Forms Instructor: Joseph Nattey.

Slides:



Advertisements
Similar presentations
Tutorial 6 Creating a Web Form
Advertisements

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.
XP Tutorial 6: Creating Web Page Forms. XP An Example of a Form.
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.
Creating Web Page Forms
Tutorial 6 Forms Section A - Working with Forms in JavaScript.
ECA 228 Internet/Intranet Design I Forms. ECA 228 Internet/Intranet Design I Forms forms are a way for a user to communicate with you – text fields –
Web Development & Design Foundations with XHTML Chapter 9 Key Concepts.
Form Handling, Validation and Functions. Form Handling Forms are a graphical user interfaces (GUIs) that enables the interaction between users and servers.
CST JavaScript Validating Form Data with JavaScript.
Chapter 9 Collecting Data with Forms. A form on a web page consists of form objects such as text boxes or radio buttons into which users type information.
1 Web Developer & Design Foundations with XHTML Chapter 6 Key Concepts.
4-Sep-15 HTML Forms Mrs. Goins Web Design Class. Parts of a Web Form A Form is an area that can contain Form Control/Elements. Each piece of information.
XP Tutorial 6New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Creating Web Page Forms Designing a Product Registration Form Tutorial.
XP Tutorial 6New Perspectives on HTML and XHTML, Comprehensive 1 Creating Web Page Forms Designing a Product Registration Form Tutorial 6.
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?
Chapter 6: Forms JavaScript - Introductory. Previewing the Product Registration Form.
XHTML Introductory1 Forms Chapter 7. XHTML Introductory2 Objectives In this chapter, you will: Study elements Learn about input fields Use the element.
HTML II. Factors to consider in designing a website. Organizing your files. HTML Tables. Unordered Lists. Ordered Lists. HTML Forms. Learning Objectives.
Robinson_CIS_285_2005 HTML FORMS CIS 285 Winter_2005 Instructor: Mary Robinson.
JavaScript, Fourth Edition Chapter 5 Validating Form Data with JavaScript.
 2008 Pearson Education, Inc. All rights reserved Introduction to XHTML.
Website Development with PHP and MySQL Saving Data.
HTML Forms.
LOGO FORMs in HTML CHAPTER 5 Eastern Mediterranean University School of Computing and Technology Department of Information Technology ITEC229 Client-Side.
1 © Netskills Quality Internet Training, University of Newcastle HTML Forms © Netskills, Quality Internet Training, University of Newcastle Netskills is.
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.
ITCS373: Internet Technology Lecture 5: More HTML.
XHTML & Forms. PHP and the WWW PHP and HTML forms – Forms are the main way users can interact with your PHP scrip Typical usage of the form tag in HTML.
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.
1 HTML Forms
1 HTML Forms
XP 1 Tutorial 6 Creating Web Page Forms. XP 2 Tutorial Objectives  Describe how Web forms can interact with a server-based program  Review the various.
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.
Web Technologies Lecture 3 Web forms. HTML5 forms A component of a webpage that has form controls – Text fields – Buttons – Checkboxes – Range controls.
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 COE 201- Computer Proficiency.
HTML Forms.
HTML Forms. A form is simply an area that can contain form fields. Form fields are objects that allow the visitor to enter information - for example text.
1 HTML Forms
Creating Forms on a Web Page. 2 Introduction  Forms allow Web developers to collect visitor feedback  Forms create an environment that invites people.
Copyright (c) 2004 Prentice-Hall. All rights reserved. 1 Committed to Shaping the Next Generation of IT Experts. Project 6: Creating XHTML Forms Kelly.
1 HTML forms (cont.)
Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
Tutorial 6 Creating a Web Form
HTML FORM. Form HTML Forms are used to select different kinds of user input. HTML forms are used to pass data to a server. A form can contain input elements.
Introduction to Web Site Development Department of Computer Science California State University, Los Angeles Lecture 8: Forms and Controls.
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.
Ashima Wadhwa Java Script And Forms. Introduction Forms: –One of the most common Web page elements used with JavaScript –Typical forms you may encounter.
XP Tutorial 6New Perspectives on HTML, XHTML, and DHTML, Comprehensive 1 Creating Web Page Forms Designing a Product Registration Form Tutorial 6.
Tutorial 6 Working with Web Forms
Chapter 5 Validating Form Data with JavaScript
ITE 115 Creating Web Page Forms
Basic XHTML Tables XHTML tables—a frequently used feature that organizes data into rows and columns. Tables are defined with the table element. Table.
Designing Forms Lesson 10.
Introducing Forms.
Objectives Explore web forms Work with form servers
CNIT 131 HTML5 - Forms.
Creating Forms on a Web Page
Chapter 6: Creating Web Page Forms. An Example of a Form.
HTML Forms
Presentation transcript:

2440: 141 Web Site Administration Web Forms Instructor: Joseph Nattey

Introducing Web Forms Web forms collect information from clients and pass data to a server. Web forms include different control elements including: Input boxes Selection lists Drop-down lists boxes Option buttons or radio buttons Check boxes Group boxes Text areas Form buttons Web Forms2

Introducing Web Forms When you create a form, divide it into topical areas The first requests contact information from the donor In the second, donor provides payment information Final part is for any comments the donor has New Perspectives on HTML and XHTML, Comprehensive3

Introducing Web Forms Web forms collect information from Web site visitors. Parts of a Web Form Information entered for a form is stored in a field and the value itself is known as the field value Some of the fields are freeform, while other fields are limited to a set of possible values. Control elements such as buttons, boxes, lists and so on, provide a way of associating a field value with a particular field New Perspectives on HTML and XHTML, Comprehensive4

Introducing Web Forms HTML supports the following control elements: input boxes for text and numerical entries option buttons also called radio buttons, for selecting a single option from a predefined list selection lists for long lists of options, usually appearing in a drop-down list box check boxes for specifying yes or no text areas for extended entries that can include several lines of text 5

Forms and Server-Based Programs 6 While HTML supports the creation of forms, it does not include tools to process the information. The information can be processed through a program running on a Web server.

Forms and Server-Based Programs Server-based programs are written in many languages The earliest and most commonly used are Common Gateway Interface (CGI) scripts that are written in Perl. Other languages include: PHP JSP ASP ASP.Net ColdFusion Python Ruby Web Forms7

Creating the Form Element Web Forms8 Forms are created using the form element, The syntax is: elements where attributes are the attributes that control how the form is processed and elements are elements places within the form.

Creating the Form Element Web Forms9 Form attributes usually tell the browser the location of the server-based program to be applied to the form’s data. Always specify an id or name for the form. Two attributes are available to identify the form: id and name.

Creating the Form Element Web Forms10 The syntax of the id and name attributes are as follows: … where name is the name of the form and id is the id of the form. Naming a form is useful for pages that contain multiple forms so you can differentiate one form from another, and it might be required for server-based programs that accept form values

Working with Form Attributes After adding the elements to your form, you’ll need to specify where to send the form data and how to send it. Use the following attributes: form elements Where: action is used to specify the address, or the filename and location of the program, that processes the form method specifies how your Web browser sends data to the server enctype specifies the format of the data stored in the form’s field Web Forms11

Working with Form Attributes The tag’s method attribute can have one of two values: post – sends the form’s data in a separate data stream, allowing the Web server to receive the data through “standard input” get – the default method which appends the form’s data to the end of the URL specified in the action attribute Never use the "get" method to pass sensitive information! (password or other sensitive information will be visible in the browser's address bar) GET is better for non-secure data, like query strings in Google Web Forms12

Interacting with a Web Server The enctype attribute determines how the form data should be encoded as it is sent to the server. 13

Using the mailto Action The mailto action accesses the user’s own program and uses it to mail form information to a specified address. By-passes the need for server-based programs. The syntax is as follows: Where _address is the address of the recipient in the form. Web Forms14

Creating Form Controls There are four primary tags used within the tag to create form controls: - the most commonly used tag which creates 10 form controls The tag’s type attribute is used to set any of the following values for the form controls: text, password, radio, checkbox, file, image, submit, button, reset, and hidden E.g., - may be used to create 3 out of the 10 controls: submit, button, and reset - displays choices (using the tag) in a drop-down menu or a scrolling list (selection list) used to create a text field with multiple lines of data Web Forms15

Creating Controls The general syntax of elements is as follows: Where type specifies the type of input field, and the name and id attributes provide the field’s name and id, respectively. Web Forms16

Creating Input Boxes (ex12) 17 Html 4 supports 10 different input types

Creating Input Boxes (exCD) 18 Html 5 adds 13 new input types color, date datetime, datetime-local , month number, range search, tel time, url, week

Creating an Input Box To create an input box, use the following HTML code: where the name and id attributes identify the field, the value attribute assigns the field’s default value, the size attribute defines the width of the input box in characters, and the maxlength attribute specifies the maximum number of characters that a user can enter into the field. Web Forms19

Setting the Size of an Input Box By default, an input box displays at 20 characters of text. To change the width of an input box, use the size attribute which is displayed as follows: Where value is the size of the input box in characters. Web Forms20

Setting the Size of an Input Box… (ex) PIN: Web Forms21

Creating a Password Field A password field is an input box where characters typed by the user are displayed as bullets or asterisks to protect private or sensitive information on a Web site. The syntax for creating a Password field is as follows: Web Forms22

Creating a Password Field Username: Password: Note: The characters in a password field are masked (shown as asterisks or circles). Web Forms23

Creating a Selection List A selection list is a list box from which a user selects a particular value or set of values. Selection lists are useful when there are a fixed set of possible responses from the user. You can create a selection list using the tag. You can specify each individual selection item using the tag. Web Forms24

Modifying the Appearance of a Selection List You can change the number of options displayed in the selection list by modifying the size attribute. The syntax is as follows: Where value is the number of items that the selection list displays in the form. Web Forms25

Modifying the Appearance of a Selection List… Web Forms26

Modifying the Appearance of a Selection List… Web Forms27 Camry Ford Fusion Volvo Saab Opel Audi

Making Multiple Selections (ex) Add the multiple attribute to the select element to create multiple selections Web Forms28

Working with Option Groups The is used to group related options in a drop- down list. If you have a long list of options, groups of related options are easier to handle for a user. You can organize the selection list options by placing them in option groups using the optgroup element. New Perspectives on HTML and XHTML, Comprehensive29

Working with Option Groups (ex) text1 text2 text1 text2 where label1, label2, and so forth are the labels for the different groups of options. The text for the label appears in the selection list above each group of items but is not a selectable item from the list. New Perspectives on HTML and XHTML, Comprehensive30

Creating Option Buttons (ex) Option buttons, or radio buttons allow users to make selections. Unlike selection lists, option buttons only allow the user to select one option at a time. Web Forms31 All option buttons belonging to the same field share a common name Labels are matched to the id values of the option buttons

Creating Check Boxes (ex) To create a check box, use: Where the name and id attributes identify the check box field and the value attribute specifies the value sent to the server if the check box is selected. To specify that a check box be selected by default, use the checked attribute as follows: or Web Forms32

Creating a Text Area Box Text area boxes allow users to enter comments about the products they’ve purchased. An input box would be too small to accommodate the length of text for this use. Web Forms33

Creating a Text Area Box To create a text area box, use the textarea element: default text Where the rows and cols attributes define the dimensions of the input box and the rows attribute indicates the number of lines in the input box. Web Forms34

Creating a Text Area Box (ex) Web Forms35

Working with Form Buttons Buttons are a type of control element that performs an action. Types of buttons: Command button Submit button Reset button File button Web Forms36

Creating a Command Button Command buttons are created using the tag: Submit buttons submit forms to the server for processing when clicked. Syntax is as follows: Reset buttons reset forms to their original (default) values. Syntax is as follows: Web Forms37

Designing a Custom Button (ex) The tag defines a clickable button. Inside a element you can put content, like text or images. Use the button element for greater artistic control over the appearance of a button. content where the type attribute specifies the button type (submit, reset, or button—for creating a command button) and content is page elements displayed within the button 38

Creating a File Button File buttons are used to select files so that their contents can be submitted for processing to a program. The Web page then only displays the file’s location, not the file’s contents. Web Forms39

Working with Hidden Fields (ex) Hidden fields are added to a form, but not displayed in the Web page. The syntax is as follows: <input type=“hidden” name=“name” id=“id” value=“value” /> Web Forms40

Working with Form Labels You can also expressly link a label with an associated text element for scripting purposes. The syntax for creating a form label is as follows: label text Where id is the value of the id attribute for a field on the form, and label text is the text of the label. Web Forms41

Web Form Example Web Forms Name: Web Forms42

Web Form Example Pin: Click on the reset button to reset the form. Web Forms43