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.

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

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
JavaScript Forms Form Validation Cookies. What JavaScript can do  Control document appearance and content  Control the browser  Interact with user.
Supplement Creating Forms. Objectives Show how forms are used How to create the Form element HTML elements used for creating input fields.
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.
JavaScript Forms Form Validation Cookies CGI Programs.
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.
Tutorial 6 Forms Section A - Working with Forms in JavaScript.
Forms. Form An HTML form is a section of a document containing normal content, special elements called controls (checkboxes, radio buttons, buttons, etc.),
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.
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
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.
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.
1 XHTML Forms A form is the mechanism to –Collect information from a browser user –Transmit collected information from a browser to a server HTML/XHTML.
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.
Robinson_CIS_285_2005 HTML FORMS CIS 285 Winter_2005 Instructor: Mary Robinson.
Suzanne J. Sultan Javascript Lecture 2. Suzanne J. Sultan function What is a function> Types of functions:  Function with no parameters  Function with.
Introduction to Programming the WWW I CMSC Summer 2004 Lecture 6.
CP476 Internet Computing Lecture 7 HTML 1 What is HTML? HyperText Markup Language (HTML) is an application of Standard Generalized Markup Language (SGML)
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.
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.
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.
Introduction to HTML Part 3 Chapter 2. Learning Outcomes Identify how to design frames. Explain frames’ attributes. Describe the method on designing forms.
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.
XHTML 1.1  Derived from Standard Generalized Markup Language (SGML) of ISO  XHTML concerned primary with content rather than presentation and style 
76 © 1998, 1999, 2000 David T. Gray, Howard Duncan, Jane Kernan Frames When displaying information in a browser, it is sometimes useful to divide the display.
ITCS373: Internet Technology Lecture 5: More HTML.
JavaScript - A Web Script Language Fred Durao
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.
HTML Forms A Preliminary Step into Dynamic Web Fred Durao
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.
1 Form Elements  Form elements have properties: Text boxes, Password boxes, Checkboxes, Option(Radio) buttons, Submit, Reset, File, Hidden and Image.
CP102 Module 7: HTML 1 Module 7: HTML 1.What is 1.What is HTML? 2. 2.Basic syntax, document structure 3. 3.Basic formatting, images, links 4. 4.Lists,
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.
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.
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.
Lecture 6 More Advanced HTML Boriana Koleva Room: C54
HTLM Forms CS3505. Form Handling in Browser html User Files out form WEbBROWSErWEbBROWSEr User read response submit Get URL?input html Get file html script.
Introduction To HTML Form Inputs Written By George Gimian.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 9 Key Concepts 1 Copyright © Terry Felke-Morris.
©SoftMooreSlide 1 Introduction to HTML: Forms ©SoftMooreSlide 2 Forms Forms provide a simple mechanism for collecting user data and submitting it to.
Project 6 Creating Forms on a Web Page. Objectives Define terms related to forms Describe the different form controls and their uses Use the tag Create.
HTML Creating Forms on a Web Page. 2 Objectives  Discuss the process of creating a form  Distinguish between data input controls and text input controls.
HTML Forms.
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.
Creating Forms on a Web Page. 2 Introduction  Forms allow Web developers to collect visitor feedback  Forms create an environment that invites people.
Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
HTML III (Forms) Robin Burke ECT 270. Outline Where we are in this class Web applications HTML Forms Break Forms lab.
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.
2440: 141 Web Site Administration Web Forms Instructor: Joseph Nattey.
How to Write Web Forms By Mimi Opkins.
Forms, cont’d.
Creating Forms on a Web Page
Presentation transcript:

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 information gathering –The form objects are called widgets (e.g., radio buttons and checkboxes, submit). –When the Submit button of a form is clicked, the form’s values are sent to the server –The server checks the values and responses accordingly There are eight types of widgets. All of the widgets, or components of a form are defined in the content of a tag –Many are created with the tag The type attribute of specifies the kind of widget being created

2 The only required attribute of is action, which specifies the URL of the application that is to be called when the Submit button is clicked. The method attribute of specifies one of the two possible techniques of transferring the form data to the server, get and post.

3 1. Text –Creates a horizontal box for text input –Default size is 20; it can be changed with the size attribute –If more characters are entered than will fit, the box is scrolled (shifted) left –If you don’t want to allow the user to type more characters than will fit, set maxlength, which causes excess input to be ignored

4 2. Checkboxes –Collect multiple choice input <input type = "checkbox" name = "groceries" value = "milk" checked = "checked" /> Milk –Every checkbox requires a value attribute, which is the widget’s value in the form data when the checkbox is ‘checked’ –A checkbox that is not ‘checked’ contributes no value to the query string –By default, no checkbox is initially ‘checked’ –To initialize a checkbox to ‘checked’, the checked attribute must be set to "checked”

5 3. Radio Buttons –Created with radio button tag –collections of checkboxes in which only one button can be ‘checked’ at a time –Every button in a radio button group MUST have the same name –If no button in a radio button group is ‘pressed’, the browser often ‘presses’ the first one

6 4. Menus Created with selection tag milk bread eggs cheese Menus that behave like checkboxes are specified by including the multiple attribute, which must be set to "multiple“ The name attribute of is required If size is set to > 1 or if multiple is specified, the menu is displayed as a pop-up menu Each item of a menu is specified with an tag, whose pure text content (no tags) is the value of the item

7 5. Text areas –created with –Usually include the rows and cols attributes to specify the size of the text area –Default text can be included as the content of – Scrolling is implicit if the area is overfilled

8 7. Password 8. Hidden field

9 6. Reset and Submit buttons –Both are created with –Submit has two actions: 1. Encode the data of the form 2. Request that the server execute the server-resident program specified as the value of the action attribute of –A Submit button is required in every form

10 What happens after submit After submit button is click 1.The browser sends the input values to the WWW server 2.Call the program indicated by the action to process the query. 3.And return an HTML document to browser 4.The browser display the result. The server side program is usually called Common Gateway Interface (CGI) See example

11 JavaScript What is JavaScript –A script language which can be used to write program inserted in HTML document to do computation on the client machine and to display the result in the browser.

12 How to add JavaScript into HTML 1.Use tag with language attribute = "JavaScript " -- JavaScript script –

13 What it can done with JavaScript Simple computation Event driven 1.User interactions with HTML documents in JavaScript 2.User interactions with form elements can be used to trigger execution of scripts Examples 1.Menus for Navigation 2.Form Validation 3.Popup Windows 4.Password Protecting 5.Math Functions 6.Special effects with document and background 7.Status bar manipulation 8.Messages 9.Mouse Cursor Effects

14 Real Example Real roots of a quadratic equation <!-- // Get the coefficients of the equation from the user var a = prompt("What is the value of 'a'? \n", ""); var b = prompt("What is the value of 'b'? \n", ""); var c = prompt("What is the value of 'c'? \n", ""); // Compute the square root and denominator of the result var root_part = Math.sqrt(b * b * a * c); var denom = 2.0 * a; // Compute and display the two roots var root1 = (-b + root_part) / denom; var root2 = (-b - root_part) / denom; document.write("The first root is: ", root1, " "); document.write("The second root is: ", root2, " "); // -->

15 Check the given link to find more JavaScript Application