1 Topic 6 Processing Form Input. 2Outline Goals and Objectives Goals and Objectives Chapter Headlines Chapter Headlines Introduction Introduction Form.

Slides:



Advertisements
Similar presentations
17 HTML, Scripting, and Interactivity Section 17.1 Add an audio file using HTML Create a form using HTML Add text boxes using HTML Add radio buttons and.
Advertisements

JavaScript and the DOM Les Carr COMP3001 Les Carr COMP3001.
Tutorial 6 Creating a Web Form
JavaScript Forms Form Validation Cookies. What JavaScript can do  Control document appearance and content  Control the browser  Interact with user.
Lesson 4 Advanced Forms Handling. Aggravations Long forms that make you scroll out of the normal viewing area Lets create a scrollable form that is a.
Web Database Programming Input Validation. User Input on the Web Web browser built-in mechanisms –HTML Forms HTTP POST method –Hyperlinks HTTP GET method.
Lesson 3 HTML Forms Handling. the Form object Tag : Properties: –action - action attribute of tag –elements[ ] - creeated from like named form elements.
JavaScript Forms Form Validation Cookies CGI Programs.
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.
Forms Describe common uses of forms on web pages
Tutorial 6 Forms Section A - Working with Forms in JavaScript.
2440: 141 Web Site Administration Web Server-Side Programming Professor: Enoch E. Damson.
Web Development & Design Foundations with XHTML Chapter 9 Key Concepts.
1 More JavaScript, HTML Forms, CGI Scripts Tom Horton Alfred C. Weaver CS453 Electronic Commerce.
Form Handling, Validation and Functions. Form Handling Forms are a graphical user interfaces (GUIs) that enables the interaction between users and servers.
Lesson 8 Creating Forms with JavaScript
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.
XP Tutorial 14 New Perspectives on HTML, XHTML, and DHTML, Comprehensive 1 Working with Forms and Regular Expressions Validating a Web Form with JavaScript.
CNIT 133 Interactive Web Pags – JavaScript and AJAX JavaScript forms.
Chapter 4 Handling User Input PHP Programming with MySQL 2nd Edition
JS: DOM Form Form Object Form Object –The Form object represents an HTML form. –For each instance of a tag in an HTML document, a Form object is created.
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
HTML Forms What is a form.
Brief Overview of Web Forms L. G. Piper Bunker Hill Community College 23 March 2011.
CO1552 Web Application Development HTML Forms. Websites can be made more interactive by providing facilities for users to provide data To get user entered.
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.
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
Chapter 5 Java Script And Forms JavaScript, Third Edition.
Chapter 6: Forms JavaScript - Introductory. Previewing the Product Registration Form.
© 2011 Delmar, Cengage Learning Chapter 9 Collecting Data with Forms.
XHTML Introductory1 Forms Chapter 7. XHTML Introductory2 Objectives In this chapter, you will: Study elements Learn about input fields Use the element.
WEEK 3 AND 4 USING CLIENT-SIDE SCRIPTS TO ENHANCE WEB APPLICATIONS.
Copyright ©2005  Department of Computer & Information Science Introducing DHTML & DOM: JavaScript & Forms.
© 2000 – All Rights Reserved - Page 1 Introduction to JavaScript Programming Part Two.
10 Adding Interactivity to a Web Site Section 10.1 Define scripting Summarize interactivity design guidelines Identify scripting languages Compare common.
JavaScript Lecture 6 Rachel A Ober
Creating Web Documents XHTML Project II topics should be posted Start Forms Homework: Forms not required for midterm or project 2. At some point, read.
Robinson_CIS_285_2005 HTML FORMS CIS 285 Winter_2005 Instructor: Mary Robinson.
1 Goals and Objectives Goals Goals Understand how JavaScript makes it possible to interact with web pages, minimizes client/server traffic, enables verification.
Forms. Forms Forms are used for e-commerce, online purchases, surveys, registrations, etc. Website using forms usually collect information and must use.
Tutorial 7 Creating Forms. Objectives Session 7.1 – Create an HTML form – Insert fields for text – Add labels for form elements – Create radio buttons.
Using Client-Side Scripts to Enhance Web Applications 1.
1 Forms and Form elements CSD 340 McCoey. 2 Form Object Properties action Usually a call to a server elements encoding method post or get target Methods.
JavaScript, Fourth Edition Chapter 5 Validating Form Data with JavaScript.
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.
 Whether using paper forms or forms on the web, forms are used for gathering information. User enter information into designated areas, or fields. Forms.
Web Development & Design Foundations with XHTML Chapter 9 Key Concepts.
1 © Netskills Quality Internet Training, University of Newcastle HTML Forms © Netskills, Quality Internet Training, University of Newcastle Netskills is.
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.
CHAPTER 7 Form & PHP. Introduction All of the following examples in this section will require two web pages. The first page retrieves information posted.
The Web Wizard’s Guide To JavaScript Chapter 3 Working with Forms.
Form Components and Elements
+ 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.
INT222 - Internet Fundamentals Shi, Yue (Sunny) Office: T2095 SENECA COLLEGE.
©SoftMooreSlide 1 Introduction to HTML: Forms ©SoftMooreSlide 2 Forms Forms provide a simple mechanism for collecting user data and submitting it to.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
HTML FORMS The TEXT Object Presented By: Ankit Gupta.
HTML Forms.
FORMS Explained By: Jasdeep Kaur. Lecturer, Department of Computer Application, PGG.C.G., Sector: 42, Chandigarh.
Ashima Wadhwa Java Script And Forms. Introduction Forms: –One of the most common Web page elements used with JavaScript –Typical forms you may encounter.
XHTML Forms.
Chapter 5 Validating Form Data with JavaScript
In this session, you will learn to:
Section 17.1 Section 17.2 Add an audio file using HTML
Validation and Building Small Apps
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.
JavaScript and Forms Kevin Harville.
Presentation transcript:

1 Topic 6 Processing Form Input

2Outline Goals and Objectives Goals and Objectives Chapter Headlines Chapter Headlines Introduction Introduction Form Object Form Object Form Objects Form Objects Form Input Validation Form Input Validation Footer Scripts Footer Scripts Form Data Processing Form Data Processing Summary Summary

3 Goals and Objectives Goals Goals Understand JavaScript form object, the objects that correspond to form elements, client side validation of form input, server side storage of form data in a spreadsheet or a database, and the difference between header and footer scripts Objectives Objectives Form backend Form backend Form object Form object Objects of form elements Objects of form elements Form input validation Form input validation Accessing form elements in JavaScript: footer scripts Accessing form elements in JavaScript: footer scripts Processing form data Processing form data Processing needs: languages (Perl, PHP, Java) and databases (Excel, mySQL) Processing needs: languages (Perl, PHP, Java) and databases (Excel, mySQL) Practice form validation and processing techniques Practice form validation and processing techniques

4 Chapter Headlines 24.1 Introduction 24.1 Introduction Learn how to stop forms on the client side Learn how to stop forms on the client side 24.2 Form Object 24.2 Form Object Find out what forms can do Find out what forms can do 24.3 Form Objects 24.3 Form Objects What is the difference between form object and objects What is the difference between form object and objects 24.4 Form Input Validation 24.4 Form Input Validation This is where to check and stop users of forms This is where to check and stop users of forms 24.5 Footer Scripts 24.5 Footer Scripts Why should we use footers? Are there headers? Why should we use footers? Are there headers? 24.6 Form Data Processing 24.6 Form Data Processing Find out what you can do with form data Find out what you can do with form data

5Introduction Learn how to create all possible form elements Learn how to create all possible form elements Form have a front end and a back end Form have a front end and a back end The two most important aspects of a form are The two most important aspects of a form are Validating form input Validating form input Storing form input in a spreadsheet or a database Storing form input in a spreadsheet or a database Validation of input ensures that the input is correct and useful Validation of input ensures that the input is correct and useful Storing of input data makes it available for future reference and use Storing of input data makes it available for future reference and use

6 Form Object Each form in a document creates a Form object Each form in a document creates a Form object JavaScript provides an array called forms to store Form objects JavaScript provides an array called forms to store Form objects Properties of Form object: action, elements, encoding, length, method, name, target Properties of Form object: action, elements, encoding, length, method, name, target Methods of Form object: handleEvent(), reset(), submit() Methods of Form object: handleEvent(), reset(), submit()

7 Form Objects Each element in a form creates a form element object Each element in a form creates a form element object Properties and Methods of form objects: Properties and Methods of form objects: Text field  defautValue, form, name, type, value  blur(), focus(), handleEvent(), select()  blur(), focus(), handleEvent(), select() Checkbox  checked, form, name, type, value  blur(), click(), focus(), handleEvent() Buttons  form, name, type, value  blur(), click(), focus(), handleEvent() Hidden  form, name, type, value File  form, name, type, value  blur(), focus(), handleEvent(), select() Select list  form, length, name, options, type, selectedIndex  blur(), focus(), handleEvent() Option  defaultSelected, selected, text, value

8 Form Input Validation JavaScript enables us to validate form input JavaScript enables us to validate form input The validate() function returns true if form input is correct The validate() function returns true if form input is correct A false return disables the action attribute of the tag without erasing any correct input A false return disables the action attribute of the tag without erasing any correct input The validation process begins by including a validation event handler with the tags The validation process begins by including a validation event handler with the tags Input can be validated at: Input can be validated at: Form level: after the entire form is completed Form level: after the entire form is completed Element level: after input in each element Element level: after input in each element Validation at form level is better than element level Validation at form level is better than element level

9 Form Input Validation Example 1 Example 1

10 Form Input Validation Example 2 Example 2

11 Form Input Validation Example 3 Example 3

12 Form Input Validation Example 4 Example 4

13 Footer Scripts Footer scripts come after the tag Footer scripts come after the tag Footer scripts can access all the XHTML objects created inside the tag Footer scripts can access all the XHTML objects created inside the tag Footer scripts may not need event handlers Footer scripts may not need event handlers Some useful applications of footer scripts are Some useful applications of footer scripts are Placing a cursor in a given form element Placing a cursor in a given form element Guide users in filling up a form Guide users in filling up a form Focus users’ attention in filling the form Focus users’ attention in filling the form

14 Form Input Validation Example 5 Example 5

15 Form Input Validation Example 6 Example 6

16 Form Input Validation Example 7 Example 7

17 Form Data Processing Form processing can be summarized in four steps: Form processing can be summarized in four steps: User fills up a form User fills up a form JavaScript verifies the input on client side before sending to the server JavaScript verifies the input on client side before sending to the server A CGI script processes the correct data on the server by extracting the values from name/value pairs A CGI script processes the correct data on the server by extracting the values from name/value pairs Store values into a spreadsheet or a database Store values into a spreadsheet or a database We must have the knowledge of: We must have the knowledge of: Databases, SQL  oracle, mySQL, MSAccess, and Excel Databases, SQL  oracle, mySQL, MSAccess, and Excel Programming languages  Perl, PHP, Servlets, JSPs, and ASPs Programming languages  Perl, PHP, Servlets, JSPs, and ASPs We can process data in combinations such as - Servlets and spreadsheets - PHP and MySQL database - Perl and processing We can process data in combinations such as - Servlets and spreadsheets - PHP and MySQL database - Perl and processing

18Summary Form have a front end and a back end and data entered has to be validated and stored Form have a front end and a back end and data entered has to be validated and stored Each form creates a Form object Each form creates a Form object Each element of a form creates a form element object Each element of a form creates a form element object Form validation is important to collect the correct inputs Form validation is important to collect the correct inputs Footer scripts have useful applications Footer scripts have useful applications Form data must be processed following the 4 step process Form data must be processed following the 4 step process