Other types of input element There are some types of input element that we have not considered: –type='image’ –type='hidden’ We will delay dealing with.

Slides:



Advertisements
Similar presentations
HTML Forms. collect information for passing to server- side processes built up from standard widgets –text-input, radio buttons, check boxes, option lists,
Advertisements

Tutorial 6 Creating a Web Form
Lecture 14 HTML Forms CPE 401 / 601 Computer Network Systems slides are modified from Dave Hollinger.
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.
Video, audio, embed, iframe, HTML Form
SE-2840 Dr. Mark L. Hornick 1 HTML input elements and forms.
Supplement Creating Forms. Objectives Show how forms are used How to create the Form element HTML elements used for creating input fields.
Capturing user input: Using HTML FORMs User input Up till now, our HTML documents have all been directed at outputting information to the user However,
The SELECT element This type of element merely offers another way of capturing the kinds of user-selection that we have already seen how to capture with.
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.
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.
Capturing user input: Using HTML FORMs CS4320 got here on 27/11/2003.
More JavaScript. JavaScript and HTML forms One of the most common usages of JavaScript is to respond to user actions when completing HTML forms JavaScript.
The conditional statement General form: if ( ) { consequent-action-list } Actual Example: if (document.getElemendById(‘name’).value= ='') { alert(‘Name.
Creating Web Page Forms
XHTML Forms for Data Collection and Submission Chapter 5.
Web Development & Design Foundations with XHTML Chapter 9 Key Concepts.
1 Web Developer & Design Foundations with XHTML Chapter 6 Key Concepts.
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.
XP Tutorial 6New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Creating Web Page Forms Designing a Product Registration Form Tutorial.
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 Sangeetha Parthasarathy 02/05/2001. Introduction to Forms A form makes it possible to transform your web pages from text to graphics to interactive.
Suzanne J. Sultan Javascript Lecture 2. Suzanne J. Sultan function What is a function> Types of functions:  Function with no parameters  Function with.
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.
BBK P1 Module2010/11 : [‹#›] Forms (Getting data from users)
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.
Tutorial 6 Working with Web Forms. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Explore how Web forms interact with.
Button and Textbox. Input  Input objects are used to obtain input from the user viewing the webpage. They allow the user to interact with the Web. 
Creating Web Page Forms. Introducing Web Forms Web forms collect information from users Web forms include different control elements including: –Input.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 9 Key Concepts 1 Copyright © Terry Felke-Morris.
FORMS. Forms are used to receive information from the web surfer, such as: their name, address, credit card, etc. Form fields are objects that allow.
1 Review of Form Elements. 2 The tag Used in between tags.  Form elements(text control, buttons, etc.. ) goes here. OR  Form elements(text control,
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.
Web Forms. Survey or poll Contact us Sign up for an newsletter Register for an event Submit comments or feedback about our site Log in to a members-only.
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.
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.
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.)
03 – HTML (2) Informatics Department Parahyangan Catholic University.
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.
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.
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.
FORMS Explained By: Jasdeep Kaur. Lecturer, Department of Computer Application, PGG.C.G., Sector: 42, Chandigarh.
XP Tutorial 6New Perspectives on HTML, XHTML, and DHTML, Comprehensive 1 Creating Web Page Forms Designing a Product Registration Form Tutorial 6.
Tutorial 6 Working with Web Forms
Web Forms.
Web Forms.
How to Write Web Forms By Mimi Opkins.
FORMS IN HTML.
FORMS Explained By: Sarbjit Kaur.
Designing Forms Lesson 10.
Introducing Forms.
HTML Forms and User Input
Creating Form Elements
Creating Form Elements
Web Development & Design Foundations with H T M L 5
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.
Forms, cont’d.
© Hugh McCabe 2000 Web Authoring Lecture 8
Lesson 6: Web Forms.
Web Forms.
Presentation transcript:

Other types of input element There are some types of input element that we have not considered: –type='image’ –type='hidden’ We will delay dealing with these until later

Other user-input elements So far we have considered two classes of user-input elements: –the button element –the input element There are two other kinds: –the select element –the textarea element

The select element This type of element merely offers another way of capturing the kinds of user-selection that we have already seen how to capture with the input elements of type=‘checkbox’ and of type=‘radio’ Consider the web page on the following slide

By clicking on the down-arrow, the user sees a range of options

This is implemented as follows : T-shirt Order form Order What is your name? Sorry! Each order is limited to one T-shirt. select the one you want: Batman's cloak Superman's cloak Dr. Who's coat Form Submission Submit order

select element vs. input element of type='radio The following select element Batman's cloak Superman's cloak Dr. Who's coat is equivalent to the following group of input elements: Batman's cloak Superman's cloak Dr. Who's coat They both allow ONLY ONE selection

Allowing multiple selections If we use the atttribute multiple in the select tag, multiple selections are allowed: Batman's cloak Superman's cloak Dr. Who's coat See the next slide

Preselection

This is done as follows: Batman's cloak Superman's cloak (our best-selling item) Dr. Who's coat

Preselection when only one selection is allowed Consider the following: Batman's cloak Superman's cloak (our best-selling item) Dr. Who's coat Notice, on the next slide, that the Superman shirt is shown as a default, even though the Batman shirt is first in the list above

What happens when the user moves to the T-shirt selection part of the form:

Sizing the selection box So far, the size of the selection box on the form has been determined by default by the browser However, we can specify a size explicitly if we wish: Batman's cloak Superman's cloak (our best-selling item) Dr. Who's coat See what results on the next slide

The textarea element With this element, we can allow the user to give us free-form feedback Consider the following web page and what happens when the user fills it in as shown on the following slides

How it was done: Feedback What do you think of our products? type your answer here … A textarea is delimited by two tags: textarea and /textarea The textarea tag has a name attribute and may have attributes which specify the size of the text-entry box -- but the user’s text can be much larger than this The text between the two tags is the initial text that appears in the text-entry box.

The remaining types of input element Now we can consider the input element that we did not consider before: –type='hidden’ –type='image’

input of type='hidden’ This has many purposes One common use is to avoid confusing a user by –hiding data which the server needs –but which the user does not need to see For example, in the following interaction, we want to hide the ID number of the item being edited

Example usage, slide#1 In the select element below, each option is of the form someName When the user clicks on the submit sutton, it is the ID, not the name, which is sent to the server

Example usage, slide#2 Below, the user has selected Al Jazeera –its ID is 1053, but the user cannot see it When the user clicks the submit button, the information sent to the server is producerID=1053

Example usage, slide#3 Below, the user can change –the spelling of the TV station’s name, in the input element of type=‘text’ –the paragraph of information about the TV station, in the textarea element But the ID number of the TV station must also be sent to the server when the submit button is clicked So the ID number must be on the form To avoid confusing the user, the ID number is in a hidden element

Source code for page on previous slide Notice the input element of type=‘hidden’ –Near the bottom of the source code Just above the button element

input of type='image’ This is for using pictures to create submit buttons It is not an element that I like to use –Later, we will see that its effect can be achieved by using JavaScript But, in case you see other people use it, I will give an example of using it here

Using an input of type=''image' form { width : 400; background-color:gray; padding:0.1in} legend { color : white }.myImage { height:25; width:25 } <?php $surname=$_POST['surname']; if ($surname) {echo "Your surname is $surname";} else {?> "> What is your surname? Submit data <?php } ?> Example program

Fresh form We can see the input element of type=‘text’ And, instead of a submit button, we see an image

The user enters his name and....

The user enters his name and clicks on the image and …

The user enters his name and clicks on the image and the name is sent to the server, which replies