©SoftMooreSlide 1 Introduction to HTML: Forms ©SoftMooreSlide 2 Forms Forms provide a simple mechanism for collecting user data and submitting it to.

Slides:



Advertisements
Similar presentations
WEB DESIGN TABLES, PAGE LAYOUT AND FORMS. Page Layout Page Layout is an important part of web design Why do you think your page layout is important?
Advertisements

Lecture 14 HTML Forms CPE 401 / 601 Computer Network Systems slides are modified from Dave Hollinger.
JavaScript Forms Form Validation Cookies. What JavaScript can do  Control document appearance and content  Control the browser  Interact with user.
Supplement Creating Forms. Objectives Show how forms are used How to create the Form element HTML elements used for creating input fields.
HTML and XHTML Controlling the Display Of Web Content.
JavaScript Forms Form Validation Cookies CGI Programs.
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.
Session 2 Tables and forms in HTML Adapted by Sophie Peter from original document by Charlie Foulkes.
Creating Web Page Forms
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 –
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.
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?
1 Forms A form is the usual way that information is gotten from a browser to a server –HTML has tags to create a collection of objects that implement this.
Chapter 5 Java Script And Forms JavaScript, Third Edition.
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.
1 HTML References: A HTML Tutorial: /HTMLPrimer.html
Forms Sangeetha Parthasarathy 02/05/2001. Introduction to Forms A form makes it possible to transform your web pages from text to graphics to interactive.
Robinson_CIS_285_2005 HTML FORMS CIS 285 Winter_2005 Instructor: Mary Robinson.
Forms. Forms Forms are used for e-commerce, online purchases, surveys, registrations, etc. Website using forms usually collect information and must use.
CSC 2720 Building Web Applications HTML Forms. Introduction  HTML forms are used to collect user input.  The collected input is typically sent to a.
© 2010 Delmar, Cengage Learning Chapter 8 Collecting Data with Forms.
JavaScript, Fourth Edition Chapter 5 Validating Form Data with JavaScript.
 2008 Pearson Education, Inc. All rights reserved Introduction to XHTML.
Chapter 8 Collecting Data with Forms. Chapter 8 Lessons Introduction 1.Plan and create a form 2.Edit and format a form 3.Work with form objects 4.Test.
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 HTML Forms
1 © Netskills Quality Internet Training, University of Newcastle HTML Forms © Netskills, Quality Internet Training, University of Newcastle Netskills is.
Introduction to HTML Part 3 Chapter 2. Learning Outcomes Identify how to design frames. Explain frames’ attributes. Describe the method on designing forms.
HTML - Forms By Joaquin Vila, Ph.D.. Form Tag The FORM tag specifies a fill-out form within an HTML document. More than one fill-out form can be in a.
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. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Explore how Web forms interact with.
TJ 3043 – Web Application Development HTML Form. 2.0 Forms A form is the usual way to communicate information from a Web browser to a server HTML has.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 9 Key Concepts 1 Copyright © Terry Felke-Morris.
1 Building FORMS In When a visitor enters information into a web form displayed in a web browser and clicks the submit button, the information is sent.
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.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 9 Key Concepts 1 Copyright © Terry Felke-Morris.
Web Page Design Forms! Website Design. Objectives What forms can do The Attributes of the form tag Using Textboxes Textareas Checkboxes Radio buttons.
+ 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.
Copyright © Texas Education Agency, All rights reserved.1 Web Technologies Website Forms / Data Acquisition.
Tutorial 6 Working with Web Forms. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Explore how Web forms interact with.
Project 6 Creating Forms on a Web Page. Objectives Define terms related to forms Describe the different form controls and their uses Use the tag Create.
Netprog CGI and Forms1 CGI and Forms A detailed look at HTML forms.
HTML Forms.
Basic Webpage Design HTML Forms. Objectives Learn how to use HTML to create a form. Explain the concept of forms Know the difference of GET and POST Discuss.
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.
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.
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.
Ashima Wadhwa Java Script And Forms. Introduction Forms: –One of the most common Web page elements used with JavaScript –Typical forms you may encounter.
2440: 141 Web Site Administration Web Forms Instructor: Joseph Nattey.
How to Write Web Forms By Mimi Opkins.
Basic XHTML Tables XHTML tables—a frequently used feature that organizes data into rows and columns. Tables are defined with the table element. Table.
Introducing Forms.
Presentation transcript:

©SoftMooreSlide 1 Introduction to HTML: Forms

©SoftMooreSlide 2 Forms Forms provide a simple mechanism for collecting user data and submitting it to a web server. –used by almost every web application The form element is used to create a data input form. –enclosed within the and tags –two primary attributes action method A document can have several forms, but the forms should not overlap. To create a “visually pleasing” layout, forms are often used in conjunction with tables.

©SoftMooreSlide 3 Flow of Information for Forms Web Server Form Processing Program BrowserBrowser User HTML Document Form Data Output Input HTML Document Form Data

©SoftMooreSlide 4 The Action Attribute The action attribute indicates URL to process the form data when it is submitted. The URL is usually a Java Servlet, a JSP page, or a CGI program. If not specified, the URL of the document containing the form is used.

©SoftMooreSlide 5 The Method Attribute The method attribute specifies the way in which the submitted data is encoded and transmitted. Two primary alternatives: Get: The form data is attached as a “query string” following the URL –Format: URL + “?” + form data –Example: Post: The data is encoded and transmitted as part of the HTTP body (via its standard input stream).

©SoftMooreSlide 6 Example Enter your name:...

©SoftMooreSlide 7 Example (continued)

©SoftMooreSlide 8 Example (continued)

©SoftMooreSlide 9 Get versus Post Historical meaning: –Post: Used to “post” data; e.g., news messages. –Get: Given an ID, go “get” the new message.  Since the Get Method passes user data within the URL, you can easily create links that act like forms. Some servers limit the length of Get requests to 240 characters. You can use POST for large forms. If security is an issue, use POST. The user data is not encrypted, but at least the data is not easily viewed by inspecting the URL.

©SoftMooreSlide 10 Basic Form Controls Text and Password Boxes Pull-Down Menus Radio Buttons Checkboxes Text Areas Hidden Fields

Basic Form Control Syntax Every form control is enclosed within and tags. A type attribute specifies the type of control –text –checkbox –submit –etc. A name attribute enables the server side program to extract the data associated with the control. Data is submitted as name-value pairs. ©SoftMooreSlide 11

©SoftMooreSlide 12 Text Controls Text boxes enable you to capture small amounts of text, such as a person’s name or an address. The size attribute –size of the text box –usually specified The maxlength attribute –maximum length of string user can enter –often omitted

©SoftMooreSlide 13 Password Controls Similar Text Controls except that data is masked so that it can’t be easily read from the user’s screen. Note: Password boxes are really not that secure. –data is not encrypted –relatively easy to “sniff” out someone’s password

©SoftMooreSlide 14 Submit/Reset Buttons Submit Button: Submits the form data Reset Button: Clears the form The value attribute –text you want to appear on the button

©SoftMooreSlide 15 Check Boxes Allow users to select one or more options. Image Video MP3 The value attribute –the text submitted to server –multiple selections allowed

©SoftMooreSlide 16 Radio Buttons As opposed to check boxes, you can select only one radio button. Image Video MP3 The value attribute –the text submitted to server

©SoftMooreSlide 17 Hidden Fields Sometimes it is useful to send hidden data fields. These fields are hidden from user, but submitted to the server just like any other piece of data. These are actually very useful for all sorts of applications –shopping carts− store checkouts –etc. Hidden fields are usually created by server-side programs that “write” the HTML document dynamically (e.g., servlets). Warning: Hidden fields can be easy to “hack”.

©SoftMooreSlide 18 Text Areas Used to submit large blocks of text. Write a short personal biography here. Attribute cols : –the width (number of columns) of the text area Attribute rows : –the height (number of rows) of the text area Attribute text : –default text that will automatically appear –usually overwritten by the user

©SoftMooreSlide 19 Select Options: Format 1 Pull-down menu – user selects only one Computer Science Mathematics Psychology History Biology

©SoftMooreSlide 20 Select Options: Format 2 Combination pull-down menu/list – user selects only one Computer Science Mathematics Psychology History Biology

©SoftMooreSlide 21 Select Options: Format 3 Combination pull-down menu/list – user selects multiple Computer Science Mathematics Psychology History Biology

©SoftMooreSlide 22 Form Validation Handling human errors and unexpected conditions. –creating forms is usually easy –validating forms usually requires more effort Two broad options for form validation Option 1: Client-side validation performed within the browser via the JavaScript language good for checking that required fields are filled in immediate feedback to the user if errors encountered Option 2: Server-side validation performed via a CGI script or Java Servlet upon submission, web server checks form data and returns a refreshed page with errors denoted