Web Development & Design Foundations with XHTML Chapter 9 Key Concepts.

Slides:



Advertisements
Similar presentations
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.
Advertisements

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.
Forms Describe common uses of forms on web pages
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.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 9 Key Concepts 1 Copyright © Terry Felke-Morris.
Creating Web Page Forms
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.
Chapter 10 Form Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D 1.
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.
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
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?
_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications1.
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.
Tables and Forms HTML5 Tables and Forms. Table Overview table element ( ) Attributes: align (left, right, center), bgcolor, border, cellpadding, cellspacing,
CSC 2720 Building Web Applications HTML Forms. Introduction  HTML forms are used to collect user input.  The collected input is typically sent to a.
Tutorial 7 Creating Forms. Objectives Session 7.1 – Create an HTML form – Insert fields for text – Add labels for form elements – Create radio buttons.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 9 Key Concepts 1 Copyright © Terry Felke-Morris.
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.
 Whether using paper forms or forms on the web, forms are used for gathering information. User enter information into designated areas, or fields. Forms.
HTML Forms.
Web Development & Design Foundations with XHTML Chapter 9 Key Concepts.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 9 Key Concepts 1 Copyright © Terry Felke-Morris.
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.
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
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.
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.
Introduction to HTML. _______________________________________________________________________________________________________________ 2 Outline Key issues.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
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.
COS 125 DAY 17. Agenda  Assignment 7 not finished grading  Assignment 8 posted Due April 9  Capstone progress reports due  Quiz 2 Corrected 2 A’s,
Copyright (c) 2004 Prentice-Hall. All rights reserved. 1 Committed to Shaping the Next Generation of IT Experts. Project 6: Creating XHTML Forms Kelly.
expanded by J. Goetz, © Pearson Education Copyright (c) 2006 Prentice-Hall. All rights reserved.
HTML III (Forms) Robin Burke ECT 270. Outline Where we are in this class Web applications HTML Forms Break Forms lab.
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.
2440: 141 Web Site Administration Web Forms Instructor: Joseph Nattey.
Tutorial 6 Working with Web Forms
How to Write Web Forms By Mimi Opkins.
Web Development & Design Foundations with HTML5 8th Edition
HTML IV (Forms) Robin Burke ECT 270.
ITE 115 Creating Web Page Forms
Web Development & Design Foundations with HTML5 8th Edition
Designing Forms Lesson 10.
Web Development & Design Foundations with H T M L 5
CNIT 131 HTML5 - Forms.
Web Development & Design Foundations with H T M L 5
Basics of Web Design Chapter 10 Form Basics Key Concepts
Presentation transcript:

Web Development & Design Foundations with XHTML Chapter 9 Key Concepts

Student Presentations 2

ADVERTISEMENT CS190: Introduction to Programming Using Visual Basic ◦ Intro class. If you are a CS major, you will still have to take CS201, but 190 covers some of the same material and is *much easier* than 201, so it gives you a head start. ◦ We won’t be doing any web programming in CS190, but one of the main uses for VB.NET is for server-side programming with Microsoft’s ASP.NET platform I’m also teaching CS290: Intro to Programming with Fortran. Fortran is not very relevant to web programming, but this class will also be an easy intro to programming. Designed for non-CS majors. 3

Overview of Forms Forms are used all over the Web to ◦ Accept information ◦ Provide interactivity Types of forms: ◦ Search form, Order form, Newsletter sign-up form, Survey form, Add to Cart form, and so on… 4

Overview of Forms (2) Form ◦ An XHTML element that contains and organizes form controls such as text boxes, check boxes, and buttons that can accept information from Web site visitors. 5

Two Components of Using Forms 1. The XHTML form -- the Web page user interface and 2. The server-side processing Server-side processing works with the form data and sends , writes to a text file, updates a database, or performs some other type of processing on the server. 6

XHTML Using Forms tag ◦ Contains the form elements on a web page ◦ Container tag tag ◦ Configures a variety of form elements including text boxes, radio buttons, check boxes, and buttons ◦ Stand alone tag tag ◦ Configures a text box ◦ Container tag tag ◦ Configures a select box (drop down list) ◦ Container tag tag ◦ Configures an option in the select box ◦ Container tag 7

Sample Form XHTML 8

XHTML element The form tag attributes: ◦ action  Specifies the server-side program or script that will process your form data  eg ◦ method  get – default value, form data passed in URL  post – more secure, form data passed in HTTP Entity Body ◦ name  Identifies the form ◦ id  Identifies the form 9

XHTML Text box Accepts text information Attributes: ◦ type=“text” ◦ name ◦ id ◦ size ◦ maxlength ◦ value 10

XHTML Text box 11

XHTML Password box Accepts text information that needs to be hidden as it is entered Attributes: ◦ type=“password” ◦ name ◦ id ◦ size ◦ maxlength ◦ value 12

XHTML Check box Allows the user to select one or more of a group of predetermined items Attributes: ◦ type=“checkbox” ◦ name ◦ id ◦ checked ◦ value 13

XHTML Radio Button Allows the user to select exactly one from a group of predetermined items Each radio button in a group is given the same name and a unique value Attributes: ◦ type=“radio” ◦ name ◦ id ◦ checked ◦ value 14

XHTML Radio Button Yes No 15

XHTML Select List Configures a select list (along with tags) Also known as: Select Box, Drop-Down List, Drop-Down Box, and Option Box. Allows the user to select one or more items from a list of predetermined choices. Attributes: ◦ name ◦ id ◦ size ◦ multiple 16

XHTML Options in a Select List Configures the options in a Select List Attributes: ◦ value ◦ selected 17

XHTML Select List Yes! No! 18

XHTML Submit Button Submits the form information When clicked: ◦ Triggers the action method on the tag ◦ Sends the form data (the name=value pair for each form element) to the web server. Attributes: ◦ type=“submit” ◦ name ◦ id ◦ value 19

XHTML Reset Button Resets the form fields to their initial values Attributes: ◦ type=“reset” ◦ name ◦ id ◦ value 20

XHTML Button Offers a flexible user interface There is no default action when the button is clicked Usually a JavaScript function is invoked when a button is clicked Attributes: ◦ type=“button” ◦ name ◦ id ◦ value 21

XHTML Hidden form data This form control is not displayed on the Web page. Hidden form fields ◦ Can be accessed by both client-side and server-side scripting ◦ Sometimes used to contain information needed as the visitor moves from page to page. Attributes: ◦ type=“hidden” ◦ name ◦ id ◦ value 22

XHTML Hidden form data Your Reply name: subject: comments: Joe Smiley wrote: : I think Hamlet doesn't act because if he does, the play's over. 23

Hands-On Practice 9.2

XHTML Using a Table to Format a Form Name: 25

XHTML Form Enhancements Tag Associates a text label with a form control Two Different Formats: Or 26

XHTML Form Enhancements & Tags The Fieldset Element ◦ Container tag ◦ Creates a visual group of form elements on a web page The Legend Element ◦ Container tag ◦ Creates a text label within the fieldset 27 Customer Information Name:

XHTML Form Enhancements tabindex attribute Attribute that can be used on form controls and anchor tags Modifies the default tab order Assign a numeric value 28

XHTML Form Enhancements accesskey attribute Attribute that can be used on form controls and anchor tags Create a “hot-key” combination to place the focus on the component Assign a value of a keyboard letter On Windows use the ALT and the “hot-key” to move the cursor (worked for me in IE and Chrome, not in Firefox) 29

XHTML Form Enhancements Image Button Submits the form When clicked: ◦ Triggers the action method on the tag ◦ Sends the form data (the name=value pair for each form element) to the Web server. Attributes: ◦ type=“image” ◦ name ◦ id ◦ src 30

XHTML Form Enhancements Element A container tag When clicked, its function depends on the value of the type attribute. Can contain a combination of text, images, and media Attributes: ◦ type=“submit”, type=“reset”, type=“button” ◦ name ◦ id ◦ alt ◦ value 31

Using CSS to Style a Form Moderate Approach ◦ Use a table to format the form but configure styles instead of XHTML table attributes. 32 table { border: 3px solid #000000; width: 100%;} td { padding: 5px; margin: 0px;}.mylabel { text-align: right;}

Using CSS to Style a Form “Pure" CSS Approach ◦ Do not use a table to format the form. ◦ Use CSS divs and spans with positioning properties to configure the page. 33 #myForm {border:3px solid #000000; padding:10px;margin:10px;}.myRow {padding-bottom: 20px;.labelCol {float:left;width:100px; text-align:right;}

Form Example 34 formsample.html

Server-Side Processing Your web browser requests web pages and their related files from a web server. The web server locates the files, may do other processing of data, and sends documents to your web browser. The web browser then renders the returned files and displays the requested web pages for you to use. 35

Common Uses of Server-Side Scripting Search a database Place an order at an online store Send a web page to a friend Subscribe to a newsletter 36

CGI Common Gateway Interface A protocol for a web server to pass a web page user's request to an application program and accept information to send to the user. 37

Server-Side Scripting One of many technologies in which a server-side script is embedded within a Web page document saved with a file extension such as: ◦.php (PHP) ◦.asp (Active Server Pages) ◦.jsp (Sun JavaServer Pages) ◦.aspx (ASP.Net). Uses direct execution — the script is run either by the Web server itself or by an extension module to the Web server. 38

Steps in Utilizing Server-Side Processing 1. Web page invokes server-side processing by a form or hyperlink. 2. Web server executes a server-side script. 3. Server-side script accesses requested database, file, or process. 4. Web server returns Web page with requested information or confirmation of action. 39

Server-Side Scripting Technologies JavaServer Pages ColdFusion PHP Ruby on Rails or Microsoft’s ASP.NET Framework

ASP.NET Benefits ◦ Good set of tools ◦ Tools are well-integrated ◦ Speedy performance (at least in development) ◦ Easy dependency management ◦ Easy design of basic GUIs and typical functionality ◦ Easy (MS) Database Access

ASP.NET Overview Drawbacks Tied to Microsoft ◦ Must do development in Windows, use IIS web server under Windows ◦ Proprietary programming languages ◦ Lose some benefits if use DB other than MS SQL Server ◦ Must trust MS to render output well for non-IE browsers ◦ No code portability Tools cost money if used in production

PHP Open source language, available free for all major environments Originally called “Personal Home Page,” but turned out to be very scalable Used by Facebook, Wikipedia, other high- volume sites Build code into scripts on the html page or link to external scripts

Wikimedia architecture

Java Web Programming CS320 and CS 520 at CSULA use Java Easy to integrate open source Java libraries for sophisticated backend functionality ◦ Security ◦ Machine Learning ◦ E-Commerce Easy to use free technologies for entire app

Java Web Programming Typically use an application framework ◦ structures the app according to a predefined architecture ◦ steep learning curve ◦ More configuration, less coding

Sources of Free Server-Side Processing Many web host providers offer free scripts for their clients for simple functionality. Contact their support area or FAQ to learn more about their services. Some web sites that offer FREE remotely hosted scripts (in return for displaying ads). ◦ ◦ ◦ ◦ ◦ ◦ ◦