Introducing Forms.

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.
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.
XP 1 Creating Web Page Forms Designing a Product Registration Form Tutorial 6.
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
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.
Form Basics CS Web Data  Most interesting web pages revolve around data  examples: Google, IMDB, Digg, Facebook, YouTube, Rotten Tomatoes  can.
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.
Creating Web Page Forms
Tutorial 6 Forms Section A - Working with Forms in JavaScript.
ECA 228 Internet/Intranet Design I Forms. ECA 228 Internet/Intranet Design I Forms forms are a way for a user to communicate with you – text fields –
Forms, Validation Week 7 INFM 603. Announcements Try placing today’s example in htdocs (XAMPP). This will allow you to execute examples that rely on PHP.
1 Web Developer & Design Foundations with XHTML Chapter 6 Key Concepts.
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.
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.
Chapter 5 Java Script And Forms JavaScript, Third Edition.
Fundamentals of Web DevelopmentRandy Connolly and Ricardo HoarFundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar Fundamentals of Web DevelopmentRandy.
Robinson_CIS_285_2005 HTML FORMS CIS 285 Winter_2005 Instructor: Mary Robinson.
CSC 2720 Building Web Applications HTML Forms. Introduction  HTML forms are used to collect user input.  The collected input is typically sent to a.
Copyright © 2004 ProsoftTraining, All Rights Reserved. Lesson 7: Web Forms.
Copyright © 2004 ProsoftTraining, All Rights Reserved. Lesson 7: Web Forms © 2007 Prosoft Learning Corporation All rights reserved ITD 110 Web Page Design.
HTML Forms.
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.
XHTML & Forms. PHP and the WWW PHP and HTML forms – Forms are the main way users can interact with your PHP scrip Typical usage of the form tag in 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.
TJ 3043 – Web Application Development HTML Form. 2.0 Forms A form is the usual way to communicate information from a Web browser to a server HTML has.
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.
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.
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.
TJ 3043 – Web Application Development HTML Form. 2.0 Forms - A form is the usual way information is gotten from a browser to a server - HTML has tags.
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 Technologies Lecture 3 Web forms. HTML5 forms A component of a webpage that has form controls – Text fields – Buttons – Checkboxes – Range controls.
+ 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.
©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.
Creating Forms on a Web Page. 2 Introduction  Forms allow Web developers to collect visitor feedback  Forms create an environment that invites people.
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.)
Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
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.
HTML Structure II (Form) WEEK 2.2. Contents Table Form.
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.
Tutorial 6 Working with Web Forms
How to Write Web Forms By Mimi Opkins.
ITE 115 Creating Web Page Forms
Basic XHTML Tables XHTML tables—a frequently used feature that organizes data into rows and columns. Tables are defined with the table element. Table.
HTML Forms and User Input
Forms, cont’d.
CNIT 131 HTML5 - Forms.
Creating Forms on a Web Page
Lesson 6: Web Forms.
Presentation transcript:

Introducing Forms

HTML Forms Richer way to interact with server Forms provide the user with an alternative way to interact with a web server (used to collect user input). Forms provide rich mechanisms like: Text input Password input Options Lists Radio and check boxes

Form Structure

How forms interact with servers

Query Strings The figure above illustrates how the form data (and its connection to form elements) is packaged into a query string A query string is a series of name=value pairs separated by ampersands (the & character). The values in the query string are the data entered by the user.

HTML Form Elements The <input> Element (single line field). It has several types (text, password, submit, reset, radio, checkbox, button, number, …etc). The <select> Element (Drop-Down list). The <textarea> Element (Multi-line field). The <button> Element (clickable button).

<form> element Two essential features of any form, namely the action and the method attributes. The action attribute specifies the URL of the server-side resource that will process the form data. In other words, it’s the action to be performed when the form is submitted. The method attribute specifies how the information entered by the user will be transmitted from the browser to the server. GET: the default method (the browser locates the name/value in the URL of the request) used to retrieve information for example in the searching process. POST: (packages the name/value pairs inside the body of the HTTP request) used to modify the contents of a date stored on the server for example modifying your personal profile.

GET vs POST

GET vs POST GET Data can be clearly seen in the address bar. Advantages and Disadvantages GET Data can be clearly seen in the address bar. Data remains in browser history and cache. Data can be bookmarked limits on the amount of information to send Used for sending non-sensitive data. POST Data can contain binary data. Data is hidden from user. Submitted data is not stored in cache, history, or bookmarks. has no limits on the amount of information to send

Syntax When to Use: $_GET[‘varname’] When the method of passing the variable is the “GET” method in HTML forms. $_POST[‘varname’] When the method of passing the variable is the “POST” method in HTML forms $_REQUEST[‘varname’] When it doesn’t matter ($_REQUEST includes variables passed from any of the above methods)

Forms Control Elements

Text Fields VALUE="text" Text fields are used when you want the user to type letters, numbers, etc. in a form. It has many attributes, the following are some of them: NAME="text“ This assigns a label to the text submitted by the user, thus identifying what the user was responding to when they filled in the text box. SIZE=“value” Specify the width of the text box in characters. MAXLENGTH=“value” Specify the maximum number of characters that can be written in the text box. If this is greater than can be displayed (as defined by the SIZE attribute, then the field will scroll. VALUE="text" Specify some default text for the text box. For more info check out this : http://www.w3schools.com/tags/tag_input.asp

Second.php Third.php

Select Lists Chose an option, any option. <select> element is used to create a multiline box for selecting one or more items The options are defined using the <option> element can be hidden in a dropdown or multiple rows of the list can be visible

Select Lists Attributes Name=text Size=value <option> Value=text This assigns a label to the item selected by the user, thus identifying what the user was responding to. Size=value The number of options to show to the user. <option> The <option> tag defines an option in a select list. The closing </OPTION> tag is optional. Value=text Specifies the value to be sent to a server. Selected Specifies that an option should be pre-selected when the page loads.

Which Value to send Select Lists Cont. The value attribute of the <option> element is used to specify what value will be sent back to the server. The value attribute is optional; if it is not specified, then the text within the container is sent instead

Radio Buttons Radio buttons are useful when you want the user to select a single item from a small list of choices and you want all the choices to be visible radio buttons are added via the <input type="radio"> element The buttons are mutually exclusive (i.e., only one can be chosen) by sharing the same name attribute for all of them within the same group. The checked attribute is used to indicate the default choice the value attribute works in the same manner as with the <option> element

Radio Buttons

Radio Buttons Name=text Value=text Checked Attributes Tells the browser which radio button group the radio button belongs to. Also serves to assign a label to the radio button group, thus identifying what the user was responding to when they selected a radio button. Value=text Specifies a value for the input element. Checked Specifies that the element represents a selected control.

Checkboxes Checkboxes are used for getting yes/no or on/off responses from the user. checkboxes are added via the <input type="checkbox”> Element You can also group checkboxes together by having them share the same name attribute Each checked checkbox will have its value sent to the server Like with radio buttons, the checked attribute can be used to set the default value of a checkbox

Checkboxes Name=text Value=text Checked Attributes Name=text Tells the browser which check box group the check box belongs to. Also serves to assign a label to the check box group, thus identifying what the user was responding to when they selected a check box. Value=text Specifies a value for the input element. Checked Specifies that the element represents a selected control.

Checkboxes

Textarea Textarea element is used to provide a editable text input area for the user. Any default text you wish to give the text area should be placed between the <textarea></textarea>. You must include the end tag even if you don't want to provide any default text. You can specify the width and height of the text area and, for some browsers, the type of wrapping to apply to the input text.

Textarea Name=text Cols=number Rows=number Attributes Specifies a name for a text area Cols=number Specifies the visible width of a text area Rows=number Specifies the visible number of lines in a text area