Spring 2014 Interim. HTML forms

Similar documents
The Hypertext Markup Language (HTML) Part II. Hamid Zarrabi-Zadeh Web Programming Fall 2013

HTML Tables and Forms. Outline. Review. Review. Example Demo/ Walkthrough. CS 418/518 Web Programming Spring Tables to Display Data"

Islamic University of Gaza Faculty of Engineering Department of Computer Engineering ECOM Advanced Internet Technology Lab.

HTML Forms. By Jaroslav Mohapl

HTML Form. Kanida Sinmai

HTML Tables and. Chapter Pearson. Fundamentals of Web Development. Randy Connolly and Ricardo Hoar

Overview of Forms. Forms are used all over the Web to: Types of forms: Accept information Provide interactivity

CMPT 165 INTRODUCTION TO THE INTERNET AND THE WORLD WIDE WEB

Server-Side Processing

Creating and Building Websites

Chapter 1 FORMS. SYS-ED/ Computer Education Techniques, Inc.

Form Overview. Form Processing. The Form Element. CMPT 165: Form Basics

COMPUTER APPLICATIONS IN BUSINESS FYBMS SEM II

1 Form Basics CSC309

LAB MANUAL SUBJECT: WEB TECHNOLOGY CLASS : T.E (COMPUTER) SEMESTER: VI

Web Programming. Based on Notes by D. Hollinger Also Java Network Programming and Distributed Computing, Chs.. 9,10 Also Online Java Tutorial, Sun.

CSE 154 LECTURE 8: FORMS

HTML Element A pair of tags and the content these include are known as an element

HTML: Fragments, Frames, and Forms. Overview

Hyperlinks, Tables, Forms and Frameworks

Web Technologies - by G. Sreenivasulu Handout - 1 UNIT - I

HTML. Asst. Prof. Dr. Kanda Runapongsa Saikaew Department of Computer Engineering Khon Kaen University

Lesson 3. Form By Raymond Tsang. Certificate Programme in Cyber Security

Summary 4/5. (contains info about the html)

SYBMM ADVANCED COMPUTERS QUESTION BANK 2013

Enterprise Knowledge Platform Adding the Login Form to Any Web Page

Q1. What is JavaScript?

Javascript. UNIVERSITY OF MASSACHUSETTS AMHERST CMPSCI 120 Fall 2010

Row and Column Spans. Homework. Column and Row Span Example (2) Column and Row Span Example. tables: Live Demo. like the following using forms:

HTML crashcourse. general structure tables forms textfield textarea selectbox listbox hidden field checkbox radiobuttons submit button

COMS 359: Interactive Media

CSC Web Technologies, Spring HTML Review

CSS CSS how to display to solve a problem External Style Sheets CSS files CSS Syntax

Chapter 3 HTML Multimedia and Inputs

Web Forms. Survey or poll Contact us Sign up for an newsletter Register for an event

Networking and Internet

HTML and JavaScript: Forms and Validation

Outline. Introducing Form. Introducing Forms 2/21/2013 INTRODUCTION TO WEB DEVELOPMENT AND HTML

Web Publishing with HTML

HTML What is HTML Hyper Text Markup Language is a computer based language used to create WebPages.

<form>. input elements. </form>

core programming HTML Forms Sending Data to Server-Side Programs Marty Hall, Larry Brown

Forms, CGI. Objectives

Chapter4: HTML Table and Script page, HTML5 new forms. Asst. Prof. Dr. Supakit Nootyaskool Information Technology, KMITL

DAY 2. Creating Forms

Creating a Web Page with HTML

HTML forms and the dynamic web

Figure 1 Forms category in the Insert panel. You set up a form by inserting it and configuring options through the Properties panel.

Advanced HTML Scripting WebGUI Users Conference

Programming of web-based systems Introduction to HTML5

Building Web Based Application using HTML

CSS Review. Objec(ves. Iden(fy the Errors. Fixed CSS. CSS Organiza(on

Creating Web Pages Using HTML

Javascript. UNIVERSITY OF MASSACHUSETTS AMHERST CMPSCI 120 Fall 2010

Forms, CGI. Cristian Bogdan 2D2052 / 2D1335 F5 1

HTML Forms IT WS I - Lecture 11

6Lesson 6: Web Forms Objectives

Session 10. Form Dataset. Lecture Objectives

Forms 4/3/2018. Two way communication. Sending Data from Client to Server. One way communication:

JavaScript CSCI 201 Principles of Software Development

CHAPTER 6: CREATING A WEB FORM CREATED BY L. ASMA RIKLI (ADAPTED FROM HTML, CSS, AND DYNAMIC HTML BY CAREY)

Forms, CGI. HTML forms. Form example. Form example...

D B M G. Introduction to databases. Web programming: the HTML language. Web programming. The HTML Politecnico di Torino 1

CS 350 COMPUTER/HUMAN INTERACTION. Lecture 6

chapter 7 Interacting with Users Tell me and I will forget. Show me and I will remember. Involve me and I will understand.

Web forms and CGI scripts

HTML HTML. Chris Seddon CRS Enterprises Ltd 1

Web Design and Development ACS Chapter 13. Using Forms 11/27/2018 1

HTML 5 Tables and Forms

Dynamic HTML becomes HTML5. HTML Forms and Server Processing. Form Submission to Web Server. DHTML - Mouse Events. CMST385: Slide Set 8: Forms

Lecture (03) from static HTML to

COMP1000 Mid-Session Test 2017s1

jquery - Other Selectors In jquery the selectors are defined inside the $(" ") jquery wrapper also you have to use single quotes jquery wrapper.

Collecting Information with Forms

NETB 329 Lecture 13 Python CGI Programming

CGI Programming. What is "CGI"?

HTML. HTML Evolution

Advanced HTML 5.1 INTRODUCTION 5.2 OBJECTIVES

UNIT-02 Hyper Text Markup Language (HTML) UNIT-02/LECTURE-01 Introduction to Hyper Text Markup Language (HTML) About HTML: [RGPV/Dec 2013(4)]

Creating Forms. Speaker: Ray Ryon

ABSOLUTE FORM PROCESSOR ADMINISTRATION OPTIONS

Information and Communication Technology (ICT) CBSE Board Question Paper 2018 Solution

Web Site Design and Development Lecture 23. CS 0134 Fall 2018 Tues and Thurs 1:00 2:15PM

Chapter 4 Sending Data to Your Application

Web Development and HTML. Shan-Hung Wu CS, NTHU

Getting Data from the Web with R

cwhois Manual Copyright Vibralogix. All rights reserved.

Web Designing HTML5 NOTES

Comp-206 : Introduction to Software Systems Lecture 23. Alexandre Denault Computer Science McGill University Fall 2006

External HTML E-form Guide

How to Set Up a Custom Challenge Page for Authentication

Outline of Lecture 5. Course Content. Objectives of Lecture 6 CGI and HTML Forms

c360 Web Connect Configuration Guide Microsoft Dynamics CRM 2011 compatible c360 Solutions, Inc. c360 Solutions

PYTHON CGI PROGRAMMING

Information Systems Engineering. Presenting data in web pages Using ASP.NET

Controlled Assessment Task. Question 1 - Describe how this HTML code produces the form displayed in the browser.

Advanced HTML. Introduction. Frames HTML Forms CGI Scripts Dynamic Documents HTML Tools Next-Generation HTML

Javascript Lecture 23

Selected Sections of Applied Informatics

blink.html 1/1 lectures/6/src/ form.html 1/1 lectures/6/src/

Transcription:

HTML forms Forms are used very often when the user needs to provide information to the web server: Entering keywords in a search box Placing an order Subscribing to a mailing list Posting a comment Filling out a survey etc. An HTML <form> element (block-level) contains and organizes form controls such as text boxes, check boxes, and buttons that can accept information from web site visitors. Useful forms require two components: 1. the user interface, that is, the web page containing the form and its controls 2. the server-side processing 9-1

Form control elements The <form> tag contains the form elements on a web page The <input> tag configures a variety of form controls including text boxes, radio buttons, check boxes, and buttons The <textarea> tag configures a scrolling text box The <select> tag configures a select box (drop down list) The <option> tag configures an option in the select box Example: <form action="what is this?"> Email: <input type="text" name="custemail" id="custemail" > <br> <input type="submit" value="submit"> </form> 9-2

The <form> tag attributes action: specifies the server-side program or script that will process your form data; in other words, this attribute specifies where to send the form data when the form is submitted method: specifies how to send the form data get : (default value) form data passed in URL post : form data passed in HTTP Entity Body (a little bit more secure) name: provides a way to reference the form in a script : uniquely identifies the form Now, we ll consider in turn several form elements. First, we ll look at the <input> element, which accepts input from the user in a variety of ways, depending on the value of its type attribute. For example, an input element can be a text box, a checkbox, a password box, a radio button, a button, and more. 9-3

Text box: <input> element with type text Accepts textual input from the user. type="text" name: Only form elements with a name attribute will have their values sent to the server when the form is submitted size: specifies the width (in characters) of the text box shown on the screen maxlength: specifies the maximum length (in characters) of the string that the user is allowed to type in, which could be more or less than the size of the text box value: defines the initial (default) value of the input box Example: <form action="form_action.asp" method="get"> First name: <input type="text" name="fname"><br> Last name: <input type="text" name="lname"><br> <input type="submit" value="submit"> </form> 9-4

Password box: <input> element with type password Accepts textual input that needs to be hidden as it is entered. type="password" name size: specifies the width (in characters) of the text box shown on the screen maxlength: specifies the maximum length (in characters) of the string that the user is allowed to type in, which could be more or less than the size of the text box value: defines the initial (default) value of the password box Example: <form action="form_action.asp" method="get"> Password: <input type="password" name="pwd" size="20"> </form> <p> Notice that the browser displays asterisks or bullets instead of characters in a password box. </p> 9-5

Check box: <input> element with type checkbox Allows the user to select one or more of a predetermined list of items. type="checkbox" name value: defines the value sent to the server if the box is checked checked: specifies that the input element should be preselected when the page loads Example: <form action="form_action.asp" method="get"> <input type="checkbox" name="vehicle1" value="bike"> I have a bike<br> <input type="checkbox" name="vehicle2" value="car" checked="checked"> I have a car <br> <input type="submit" value="submit"> </form> <p>click on the submit button, and the input will be sent to a page on the server called "form_action.asp".</p> 9-6

Radio button: <input> element with type radio Allows the user to select exactly one from a predetermined list of items. type="radio" name: must be the same for all the radio buttons in the group value: defines the value sent to the server if the radio button is selected checked: specifies that the input element should be preselected when the page loads Example: <form action="form_action.asp" method="get"> <input type="radio" name="sex" value="male"> Male<br> <input type="radio" name="sex" value="female" checked="checked"> Female<br> <input type="submit" value="submit"> </form> 9-7

Submit/reset buttons: <input> element with type submit/reset The submit button sends the form data (that is, the name=value pair for each form element) to the web server: when clicked, it triggers the action method set in the <form> tag. type="submit" name value: defines the text on the button The reset button resets the form fields to their initial values. type="reset" name value: defines the text on the button 9-8

Button: <input> element with type button Creates a generic button without a default action when the button is clicked. Usually a JavaScript function is defined and invoked when the button is clicked. type="button" name value: defines the text on the button 9-9

Scrollable text area: <textarea> element Creates a multi-line text input control in which the user can write an unlimited number of characters. name cols: specifies the visible width of a text area (better done with CSS) rows: specifies the visible height of a text area (better done with CSS) Example: <textarea rows="3" cols="20"> At W3Schools you will find all the Web-building tutorials you need, from HTML to CSS and JavaScript. </textarea> 9-10

Drop-down list: <select> element Creates, together with the <option> tag, a select list (AKA drop-down list/box, select box, option box) name size: specifies the number of visible options in the drop-down list multiple: specifies that multiple options can be selected The <option> element has attributes selected and value Example: <form action="form_action.asp" method="get"> <select name="car"> <option>volvo</option> <option>saab</option> <option>mercedes</option> <option>audi</option> </select> <input type="submit" value="submit"> </form> 9-11

Hidden field: <input> element with type hidden Defines a hidden field which is not visible by the user but can store a default value or have its value changed via JavaScript code. type="hidden" name value: defines the value sent to the server We ll use this type of form control in an upcoming lab. 9-12

Server-side processing Your web browser requests web pages and their related files from a web server. The web server locates the files and sends them to your web browser. The web browser then renders the returned files and displays the requested web pages to the user. 9-13

Server-side scripting The Common Gateway Interface (CGI) is a standard that defines how web server software can delegate the generation of web pages to another software program called a CGI script that uses data provided by the user (through a form, for example). 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 (Microsoft s Active Server Pages).cfm (Adobe s ColdFusion markup language).jsp (Sun s JavaServer Pages).aspx (Microsoft s ASP.Net) 9-14

Steps in server-side processing 1. The user invokes server-side processing by submitting form data or clicking a hyperlink on a web page 2. The web server executes a server-side script 3. The server-side script accesses a database, or reads/write files, etc. 4. The web server returns a web page with the requested information or a confirmation of action Common uses of server-side processing: Search a database Place an order at an online store Send a web page to a friend Subscribe to a newsletter 9-15

Lab 10 form 9-16

Lab 10 form: Skeleton code <body> <form action="http://www.uwosh.edu/cgi-bin/mailto.cgi" method="post"> <input type="hidden" name="to" value="furcyd@uwosh.edu"> <input type="hidden" name="from" value="cs125 student"> <input type="hidden" name="subject" value="pizza order"> <table> <tr> <td colspan="2" class="...">dave s Pizza - Order Form</td> </tr> <tr> <td>phone number:</td> <td>...</td> </tr> <tr> <td>pizza size:</td> <td>...</td> </tr>... </table> </form> </body> 9-17

Lab 10 with borders 9-18