CHAPTER 6 GETTING USER INPUT WITH FORMS. LEARNING OBJECTIVES Use the and tag pair to define an HTML-based form Use the tag to create a text box for user.

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

23-Aug-14 HTML/XHTML Forms. 2 What are forms? is just another kind of XHTML/HTML tag Forms are used to create (rather primitive) GUIs on Web pages Usually.
24-Aug-14 HTML Forms. 2 What are forms? is just another kind of HTML tag HTML forms are used to create (rather primitive) GUIs on Web pages Usually the.
Tutorial 6 Creating a Web Form
1 Topic 6 Processing Form Input. 2Outline Goals and Objectives Goals and Objectives Chapter Headlines Chapter Headlines Introduction Introduction Form.
1 Chapter 5 – Handling HTML Controls in Web Pages spring into PHP 5 by Steven Holzner Slides were developed by Jack Davis College of Information Science.
JavaScript Forms Form Validation Cookies. What JavaScript can do  Control document appearance and content  Control the browser  Interact with user.
Chapter 6 Basic forms 1. Forms and query string 2 form : a group of user input (UI) controls that accepts information from the user and sends the information.
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.
CHAPTER 30 THE HTML 5 FORMS PROCESSING. LEARNING OBJECTIVES What the three form elements are How to use the HTML 5 tag to specify a list of words’ form.
Web Database Programming Input Validation. User Input on the Web Web browser built-in mechanisms –HTML Forms HTTP POST method –Hyperlinks HTTP GET method.
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.
Gathering Requirements What do users want?. Information Gathering Techniques Surveys Interviews Focus Groups.
Web Development & Design Foundations with XHTML Chapter 9 Key Concepts.
Chapter 10 Form Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D 1.
CSE 154 LECTURE 9: FORMS. Web data most interesting web pages revolve around data examples: Google, IMDB, Digg, Facebook, YouTube, Rotten Tomatoes can.
CST JavaScript Validating Form Data with JavaScript.
1 Web Developer & Design Foundations with XHTML Chapter 6 Key Concepts.
MS3304: Week 4 PHP & HTML Forms. Overview HTML Forms elements refresher Sending data to a script via an HTML form –The post vs. get methods –Name value.
Unit 7 – Working with Forms 1. Creating a form 2. Accessing the submitted data 3. Common operations on forms.
Advance Database Management Systems Lab no. 5 PHP Web Pages.
Reading Data in Web Pages tMyn1 Reading Data in Web Pages A very common application of PHP is to have an HTML form gather information from a website's.
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.
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
HTML Forms What is a form.
XP Tutorial 6New Perspectives on HTML and XHTML, Comprehensive 1 Creating Web Page Forms Designing a Product Registration Form Tutorial 6.
CO1552 Web Application Development HTML Forms. Websites can be made more interactive by providing facilities for users to provide data To get user entered.
Lecture 6 – Form processing (Part 1) SFDV3011 – Advanced Web Development 1.
Forms and Form Controls Chapter What is a Form?
CSE 382/ETE 334 Internet and Web Technology Presented By Dr. Shazzad Hosain Asst. Prof. EECS, NSU.
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.
XHTML Introductory1 Forms Chapter 7. XHTML Introductory2 Objectives In this chapter, you will: Study elements Learn about input fields Use the element.
Robinson_CIS_285_2005 HTML FORMS CIS 285 Winter_2005 Instructor: Mary Robinson.
Section 17.1 Add an audio file using HTML Create a form using HTML Add text boxes using HTML Add radio buttons and check boxes using HTML Add a pull-down.
JavaScript, Fourth Edition Chapter 5 Validating Form Data with JavaScript.
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.
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.
HTML and FORMS.  A form is an area that can contain form elements.  Form elements are elements that allow the user to enter information (like text fields,
HTML FORMS GET/POST METHODS. HTML FORMS HTML Forms HTML forms are used to pass data to a server. A form can contain input elements like text fields, checkboxes,
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 9 Key Concepts 1 Copyright © Terry Felke-Morris.
The Web Wizard’s Guide To JavaScript Chapter 3 Working with Forms.
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.
Web Page Design Forms! Website Design. Objectives What forms can do The Attributes of the form tag Using Textboxes Textareas Checkboxes Radio buttons.
Copyright © Texas Education Agency, All rights reserved.1 Web Technologies Website Forms / Data Acquisition.
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.
HTML Forms.
HTML FORMS Basharat Mahmood, Department of Computer Science,CIIT,Islamabad,Pakistan. 1.
Copyright (c) 2004 Prentice-Hall. All rights reserved. 1 Committed to Shaping the Next Generation of IT Experts. Project 6: Creating XHTML Forms Kelly.
Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
1 Web Engineering Forms Lecture 05. FORMS Its how HTML does interactivity. There are quite new feature in HTML5. But the fundamental idea does not change.
Learning Aim C.  In this section we will look at how text, tables, forms and frames can be used in web pages.
Tutorial 6 Creating a Web Form
HTML III (Forms) Robin Burke ECT 270. Outline Where we are in this class Web applications HTML Forms Break Forms lab.
Introduction to Web Site Development Department of Computer Science California State University, Los Angeles Lecture 8: Forms and Controls.
Unit 4 Working with data. Form Element HTML forms are used to pass data to a server. A form can contain input elements like text fields, checkboxes, radio-buttons,
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.
Chapter 5 Validating Form Data with JavaScript
Section 17.1 Section 17.2 Add an audio file using HTML
FORMS Explained By: Sarbjit Kaur.
Getting User Input with Forms
Validation and Building Small Apps
Web Systems Development (CSC-215)
Presentation transcript:

CHAPTER 6 GETTING USER INPUT WITH FORMS

LEARNING OBJECTIVES Use the and tag pair to define an HTML-based form Use the tag to create a text box for user input within a form Use the tag to create radio buttons which simplify user selection within a form Use the tag to create checkboxes to allow users to select multiple options within a form Use the tag to create a button within a form Use the and tag pair to define a pull-down list within a form Use the and tag pair to prompt the user for large amount of text within a form. Group related input fields within a form

LEARNING OBJECTIVES CONTINUED Group related items within a pull-down list Submit a form’s contents to a remote script Compare and contrast server-side script validation of a form’s data with client- side JavaScript validation

SIMPLE FORM – PROMPT ONLY – NO ACTION Name:

SUBMISSION PROCESS

BUTTON, BUT STILL NO SUBMIT Name:

SPECIFYING THE SUBMIT ACTION Name:

FORMECHO.PHP "; foreach($_POST as $key => $val){ if (is_array($val)){ $msg.="Item: $key "; foreach($val as $v){ $v = stripslashes($v); $msg.=" $v "; } } else { $val = stripslashes($val); $msg.="$key: $val "; } } echo $msg; ?>

PUTTING CONTENT INTO THE FORM What's Your Favorite Food:

PROMPTING FOR A PASSWORD Username: Password:

SPECIFYING FIELD MAX LENGTHS Five: Ten: Twenty:

USING A TEXTAREA FOR LARGER INPUT Text Area:

RADIO BUTTONS Gender: Male Female PC Type: Windows Mac

SELECTING A DEFAULT RADIO BUTTON Male Female

CHECKBOXES Desired Pizza Toppings: Cheese Pepperoni Bacon Pineapple

PULL-DOWN LISTS Salutation: Dr Mr Mrs Miss Ms Favorite Sport: Baseball Basketball Football Hockey Soccer

PULL-DOWN LIST SIZE Salutation:

SELECTING MULTIPLE ELEMENTS Favorite Sport: Baseball Basketball Football Hockey Soccer

RESETTING A FORM’S CONTENTS Name: Phone: Programming Languages: C Java VB

CREATING A CUSTOM BUTTON

USING FIELD LABELS First name: Last name:

ING A FORM’S CONTENTS Name:

HIDDEN FORM FIELDS Name:

UPLOADING A FILE File:

PROCESSING A FILE UPLOAD WITH PHP 0) { echo "Error: ". $_FILES["file"]["error"]. " "; } else { echo "Upload: ". $_FILES["file"]["name"]. " successful "; echo "Stored in: ". $_FILES["file"]["tmp_name"]; } ?>

GROUPING FIELDS Name: Salutation: Dr Mr Mrs Miss Ms Favorite Sport: Baseball Basketball Football Hockey Soccer

GROUPING LIST SELECTIONS Wines: Chardonnay Pinot Grigio Sauvignon Blanc Cabernet Sauvignon Merlot Pinot Noir

REAL WORLD: FORM VALIDATION function validateForm() { if (document.forms["myForm"]["name"].value==null || document.forms["myForm"]["name"].value=="") { alert("Name must be filled out"); return false; } if (document.forms["myForm"]["phone"].value==null || document.forms["myForm"]["phone"].value=="") { alert("Phone must be filled out"); return false; } if (document.forms["myForm"][" "].value==null || document.forms["myForm"][" "].value=="") { alert(" must be filled out"); return false; } return true; } Name: Phone:

SUMMARY Depending on the processing a Web page performs, it is common for the page to require user input of some type. To perform such input operations, HTML pages use forms. Across the Web, sites use forms to prompt the user for login credentials, to request registration data, to get credit card and shipping information, and much more. You use the and tag pair to define a form and the tag to create the most common form input fields. To perform form processing normally requires that one developer use HTML tags to create the form and that a second developer create scripts, using PHP or another scripting language, which process the data on the remote server.