Lecture # 6 Forms, Widgets and Event Handling. Today Questions: From notes/reading/life? Share Personal Web Page (if not too personal) 1.Introduce: How.

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

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?
Tutorial 6 Creating a Web Form
The Web Warrior Guide to Web Design Technologies
Lecture # 9 JavaScript Programming I. Today Questions: From notes/reading/life? Spreadsheet Review Preview Lab # 4 1.Introduce: How can I write a program.
Browsers and Servers CGI Processing Model ( Common Gateway Interface ) © Norman White, 2013.
Forms cs105. More Interactive web-pages So far what we have seen was to present the information. (Ex: tables. Lists,….). But it is not enough. We want.
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
Python and Web Programming
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.
CGI Programming: Part 1. What is CGI? CGI = Common Gateway Interface Provides a standardized way for web browsers to: –Call programs on a server. –Pass.
Creating Web Page Forms
Tutorial 6 Forms Section A - Working with Forms in JavaScript.
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.
INTRODUCTION TO WEB DEVELOPMENT AND HTML Lecture 07: Forms - Spring 2011.
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.
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.
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 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 6: Forms JavaScript - Introductory. Previewing the Product Registration Form.
Server-side Scripting Powering the webs favourite services.
XHTML Introductory1 Forms Chapter 7. XHTML Introductory2 Objectives In this chapter, you will: Study elements Learn about input fields Use the element.
225 City Avenue, Suite 106 Bala Cynwyd, PA , phone , fax presents… HTML Lists, Tables and Forms v2.0.
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.
WWW Forms and Search. Forms URL - always fetch a particular page What if the information we want varies from time to time and from user to user?
JavaScript – Quiz #9 Lecture Code:
JavaScript, Fourth Edition Chapter 5 Validating Form Data with JavaScript.
Active Server Pages  In this chapter, you will learn:  How browsers and servers interacted on the Internet when the Internet first became popular 
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.
HTML Forms.
LOGO FORMs in HTML CHAPTER 5 Eastern Mediterranean University School of Computing and Technology Department of Information Technology ITEC229 Client-Side.
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.
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.
1 HTML Forms
HTML Form Widgets. Review: HTML Forms HTML forms are used to create web pages that accept user input Forms allow the user to communicate information back.
Lecture # 10 JavaScript Programming II. Today Questions: From notes/reading/life? Review Homework # 2 1.Introduce: How make widgets work with JavaScript?
HTML Forms. Slide 2 Forms (Introduction) The purpose of input forms Organizing forms with a and Using different element types to get user input A brief.
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.
©SoftMooreSlide 1 Introduction to HTML: Forms ©SoftMooreSlide 2 Forms Forms provide a simple mechanism for collecting user data and submitting it to.
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 The TEXT Object Presented By: Ankit Gupta.
Creating Web Page Forms COE 201- Computer Proficiency.
Week 10: HTML Forms HNDIT11062 – Web Development.
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.
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.
Java Script Programming. Review: Event Handling Text Box Title: Button.
INTERNET APPLICATIONS CPIT405 Forms, Internal links, meta tags, search engine friendly websites.
Tutorial 6 Creating a Web Form
Web Forms. Web Forms: A form allows our web visitors to submit information to us. Some examples uses for forms are to let the web user contact us, fill.
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.
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.
Section 10.1 Define scripting
Section 17.1 Section 17.2 Add an audio file using HTML
Presentation transcript:

Lecture # 6 Forms, Widgets and Event Handling

Today Questions: From notes/reading/life? Share Personal Web Page (if not too personal) 1.Introduce: How do we make web pages interactive? 2.Explain: Forms, Widgets and Event Handling 3.Demo: Interactive Web pages – follow along on laptop 4.Practice: Your group will create an interactive web page 5.Evaluate: Share and evaluate web pages 6.Re-practice:Create your own web page with Lab # 3 Preview Lab # 3 Review Data Representation Understand Understand how web searching works

Today Questions: From notes/reading/life? Share Personal Web Page (if not too personal) 1.Introduce: How do we make web pages interactive? 2.Explain: Forms, Widgets and Event Handling 3.Demo: Interactive Web pages – follow along on laptop 4.Practice: Your group will create an interactive web page 5.Evaluate: Share and evaluate web pages 6.Re-practice:Create your own web page with Lab # 3 Preview Lab # 3 Review Data Representation Understand Understand how web searching works

How does a web page… Accept user input Include buttons, text boxes, labels, etc. Send information in a URL link Dynamically respond to the user Answer: Forms

Forms

Forms - requests to a web-site How to get information from the user When to send the request Where to send the request How to send the user ’ s information with the request

Example form First name Last name

Labels Example form First name Last name

Labels

How to get info from the user Example form First name Last name

Parts to an input tag Name - the name that this input information will be given Size - the number of characters that the user can type Value – what initially appears in the input

When to send the request Example form First name Last name

When to send the request

Where to send the request Example form First name Last name

How to send the user information in a URL Example form First name Last name

How to send the user information in a URL Example form First name Last name

How to send the user information in a URL Example form First name Last name

Forms - How does the server respond? Not every URL refers to a page CGI - Common Gateway Interface You can give a server a program and place it at a URL. The server will then run the program and return its result rather than fetch a page

CGI Programs After the user enters the information, they press the “ submit ” button to send the information to the web server The attribute tells the web browser where to send the information The action URL is the address of a CGI program that is running on a web server The CGI program reads the user input sent by the browser, and then sends a dynamically generated HTML page back to the browser This is what Google does when you do a Google search

Server-side Scripting Information is sent to the web server, often through the URL There is a CGI program running on the web server The CGI program runs using the user input The server sends a dynamically generated HTML page back to the client browser

Client-side Scripting Not all HTML forms contact a CGI program on a web server Some forms execute entirely on the client computer The “ program ” is included as part of the HTML page that contains the form, and is executed by the browser This program is sometimes called a “ script ”, and is written in a programming language named JavaScript Many web sites use a combination of CGI programs and client-side scripting

HTML Form Widgets

Pizza Order Demo

HTML Form Widgets Text Box Button Check Box Radio Buttons Text Area Selection List

Text Box Attributes –size (the width of the text box in characters) –maxlength (the maximum number of characters the user is allowed to type in the text box) –name (the name of the variable used to reference the text box from JavaScript) –value (the string currently in the text box)

Problem: What if we want to put text boxes, buttons, check boxes, etc. in nice, neat rows and columns? How can we do this?

Text Box Demo Text Box Title:

Button Attributes –value (string label on the button) –name (the name of the variable used to reference the button from JavaScript)

Button Demo Button

Check Box Attributes –checked (if this attribute is present, the box will be checked when the form loads) –name (the name of the variable used to reference the check box from JavaScript)

Check Box Demo Check Box US Citizen:

Radio Buttons Attributes –checked (if this attribute is present, the radio button will be selected when the form loads) –name (the name of the variable used to reference the radio button from JavaScript) NOTE: All radio buttons in the same group must be given the same name

Radio Buttons Demo Radio Buttons Freshman Sophomore Junior Senior

Text Area The value string goes here between the tags Attributes –cols (the width of the text area in characters) –rows (the height of the text area) –name (the name of the variable used to reference the text area from JavaScript)

Text Area Demo Text Area Type your address here.

Selection List Option 1 Option 2 …

Selection List Attributes –size (the number of options that should be visible) –name (the name of the variable used to reference the selection list from JavaScript) Attributes –selected (if this attribute is present, the option will be selected when the form loads)

Selection List Demo Selection List red green blue cyan magenta yellow

Event Handling Now that we have this nice form, there ’ s only one problem – it doesn ’ t do anything!

Event Handling We add behavior to HTML forms by adding “ event handlers ” to widgets An event handler is a little program that is run whenever a particular event occurs in a widget Examples of events: onClick for buttons, onChange for text boxes Example event handler: When this button is clicked, compute the tax and total for the order

Event Handling Each type of HTML form widget has “ event handler attributes ” The value of an event handler attribute is a JavaScript program that describes the actions to be performed when that particular event occurs in the widget

Event Handling Demo Text Box Title: Button

Event Handling We ’ ll learn a lot more about event handling in a future lecture, when we learn the basics of JavaScript programming Once we ’ ve learned about JavaScript, we ’ ll be able to add interesting behavior to our HTML forms

Today Questions: From notes/reading/life? Share Personal Web Page (if not too personal) 1.Introduce: How do we make web pages interactive? 2.Explain: Forms, Widgets and Event Handling 3.Demo: Interactive Web pages – follow along on laptop 4.Practice: Your group will create an interactive web page 5.Evaluate: Share and evaluate web pages 6.Re-practice:Create your own web page with Lab # 3 Preview Lab # 3 Review Data Representation Understand Understand how web searching works

Personal Exercise Create a Text Box with a Title and a Label that looks like this: And a button with a Title and a Label that looks like this: Type Hi in the text box and make sure that works When you click on the “BYE” button, make the Text Box say “BYE” You have 10 minutes

Problem: Searching the Internet How do you find a web page if you don ’ t know the URL? One of the more popular search engines is Google

Search How do we describe the page that we want?

Search How does Google know where that page is? WEB CRAWLERS: –Find as many web pages as you can –For each web page prepare a list of words on that page –For each word in all of the web keep a list of pages that have that word

How does your browser ask for the search

Problems with word searches Search for “ doctor ” What about pages with the word “ doctors ” ? What about pages with the word “ physicians ” ? What about pages about “ witch doctors ” ? What if the page only has a picture of a doctor? What if the only use of the word doctor is in a picture?

Blocking pornography The reverse of the search problem I don ’ t want pages that have this –How do you describe what you don ’ t want?

Blocking pornography Keep a list of all bad sites –If site is on the black list then refuse to make an Internet connection –What if someone creates a new site? Keep a list of bad words and block any URL or page that has those words –What about “ Middlesex, England ” ? –What about “ breast cancer ” ? –What about slang words? –What about pictures?

Summarize It is hard to find all the pages someone might be interested in It is hard to NOT find pages someone is never interested in Mistakes are often made, you can ’ t be 100% right

Static vs. Dynamic Sometimes the information we want displayed on a web page varies from time to time and from user to user So far, all our web pages have been static, i.e. always looks the same Some web pages, like a Google result page, are dynamic, i.e. different each time