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

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

CMPT 165 INTRODUCTION TO THE INTERNET AND THE WORLD WIDE WEB

Spring 2014 Interim. HTML forms

HTML Form. Kanida Sinmai

COMPUTER APPLICATIONS IN BUSINESS FYBMS SEM II

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

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

WEBD 236 Web Information Systems Programming

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

HTML Forms. By Jaroslav Mohapl

Chapter 3 HTML Multimedia and Inputs

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

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

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

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

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"

DAY 2. Creating Forms

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

1 Form Basics CSC309

SYBMM ADVANCED COMPUTERS QUESTION BANK 2013

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

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

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

HTML: Fragments, Frames, and Forms. Overview

HTML Forms IT WS I - Lecture 11

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

Lecture (03) from static HTML to

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

Javascript. UNIVERSITY OF MASSACHUSETTS AMHERST CMPSCI 120 Fall 2010

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

CSE 154 LECTURE 8: FORMS

Creating and Building Websites

HTML and JavaScript: Forms and Validation

Hyperlinks, Tables, Forms and Frameworks

Practice problems. 1 Draw the output for the following code. 2. Draw the output for the following code.

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

Forms, CGI. Objectives

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.

Dreamweaver: Web Forms

Programming of web-based systems Introduction to HTML5

Javascript. UNIVERSITY OF MASSACHUSETTS AMHERST CMPSCI 120 Fall 2010

Creating Web Pages Using HTML

Q1. What is JavaScript?

Networking and Internet

Last &me: Javascript (forms and func&ons)

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

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

Enterprise Knowledge Platform Adding the Login Form to Any Web Page

Advanced Internet Technology Lab # 5 Handling Client Requests

HTML forms and the dynamic web

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

HTML. MPRI : Web Data Management. Antoine Amarilli Friday, December 7th 1/28

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

Building Web Based Application using HTML

Table Basics. The structure of an table

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

NETB 329 Lecture 13 Python CGI Programming

Form Processing in PHP

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

Web Publishing with HTML

HTML and CSS MIS Konstantin Bauman. Department of MIS Fox School of Business Temple University

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

Creating Forms. Speaker: Ray Ryon

ABSOLUTE FORM PROCESSOR ADMINISTRATION OPTIONS

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

PYTHON CGI PROGRAMMING

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

Collecting Information with Forms

HTTP and HTML. We will use HTML as a frontend to our webapplications, therefore a basic knowledge of HTML is required, especially in forms.

CSCB20 Week 11. Introduction to Database and Web Application Programming. Anna Bretscher* Winter 2017

How to structure a web application with the MVC pattern

External HTML E-form Guide

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

Web Designing Course

HTML 5 Tables and Forms

Chapter 4 Sending Data to Your Application

Produced by. Web Development. Eamonn de Leastar Department of Computing, Maths & Physics Waterford Institute of Technology

Web Focused Programming With PHP

LEARNING TO LOVE FORMS THE AJAX EXPERIENCE 2007

<form>. input elements. </form>

CSC Web Technologies, Spring HTML Review

Wishlist 1-Click Registration Manual

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

LAB Test 1. Rules and Regulations:-

Lecture 6: More Arrays & HTML Forms. CS 383 Web Development II Monday, February 12, 2018

SilkTest 2009 R2. Rules for Object Recognition

Javascript, Java, Flash, Silverlight, HTML5 (animation, audio/video, ) Ajax (asynchronous Javascript and XML)

CS 350 COMPUTER/HUMAN INTERACTION. Lecture 6

IEEM 230. PHP Basics, Part IV. Objectives of the lab:

CSE 154 LECTURE 9: SUBMITTING DATA (POST)

cwhois Manual Copyright Vibralogix. All rights reserved.

PHP with MySQL: What you need to know Chapter 3. This section is on using PHP script tags appropriately in your PHP program.

COMS 359: Interactive Media

WRITING LINKS. <a href="

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

Session 10. Form Dataset. Lecture Objectives

Chapter 2 How to structure a web application with the MVC pattern

UNIVERSITY OF TORONTO Faculty of Arts and Science APRIL 2016 EXAMINATIONS. CSC309H1 S Programming on the Web Instructor: Ahmed Shah Mashiyat

Transcription:

HTML Forms

Overview of Forms Forms are used all over the Web to: Accept information Provide interactivity Types of forms: Search form, Order form, Newsletter sign-up form, Survey form, Add to Cart form, Login form, and so on 2

Form Elements The <form> element can contain one or more of the following sub-elements: <input> <textarea> <button> <select> <option> <optgroup> <fieldset> <label>

Form Controls: <input> The input element of a form allows various kinds of data to be accepted from the user. Include one of the following type attributes: text password hidden radio checkbox submit reset 4

type="text" <form> First name:<input type="text"><br> Last name:<input type="text"><br> </form> The type= "text" attribute creates a 20-character box for user input. How the HTML code above looks in a browser:

type="password" <form> Password:< input type="password" name="pwd"> </form> This attribute creates a standard text box but with bullets instead of characters as the user types. How the HTML code above looks in a browser: Note: this does not encrypt the password; it simply provides a shield for anyone looking at the user s screen.

type= "hidden" Use the hidden type attribute for sending string values along with other data that the user doesn t see or input a product ID for example <input type="hidden" name="productid" value="c1003">

The Name Attribute <form> First name:< input type="text name="firstname"><br> Last name:< input type="text" name="lastname"><br> </form> Creates variables, firstname and lastname which hold the values of the strings entered into each text box.

Radio Buttons Radio buttons let a user select ONLY ONE of a limited number of choices: <form> < input type="radio" name="gender" value="m">male<br> < input type="radio" name="gender" value="f">female<br> </form> How the HTML code above looks in a browser: Note: The value attribute is needed here. Why?

Checkboxes Checkboxes let a user select ZERO or MORE options of a limited number of choices. <form> < input type="checkbox" name="bike">i have a bike<br> < input type="checkbox" name="car">i have a car <br> < /form> Note: The (variable) names are different. Why?

Selection Selection, or drop-down, lists typically allow the user to select one value from a list of options. <form> <select name="cars"> </select> </form> <option value="volvo">volvo</option> <option value="saab">saab</option> <option value="fiat">fiat</option> <option value="audi">audi</option>

Text Areas The HTML for a text area with default text: Comments:<br> <textarea name="comments" placeholder="if you have any comments, please enter them here."> </textarea> Note: This input will require special handling. More to come about that later

type= "submit" <input type="submit"> The submit button is used to send form data somewhere for processing. The data is sent to the page specified in the form's action attribute. The file defined in the action attribute usually does something with the received input: <form name="input" action= "xxx.php" method="get"> Username: <input type="text" name="user"> <input type="submit" value="submit"> < /form> How the HTML code above looks in a browser: The value attribute specifies the text to display on the button

type= "reset" <input type= "reset" value= "Reset"> The value attribute specifies the text to display on the button 14

Attributes of the <form> element: name: identifier for the form action: URL of the file that will process the data method: HTTP method for submitting the data; get or post [target]: where to open the pages specified in the action attribute; _blank opens in a new window or tab.

Get or Post? Get: form data is sent as part of URL the data is visible and can be bookmarked The URL when the form is submitted with the get method: subscribe.php?email=zak%40modulemedia.com&submit=subscribe Post: form data is packaged as part of an HTTP request and isn t visible by the browser more secure resulting page can t be bookmarked

Accessibility guideline Use labels associate text with form input controls so the user can click on the label text to select the control that the label is associated with. This also helps assistive devices.

Label element <label></label> Associates a text label with a form control Two Different Formats: <label> <input type="radio" name= "crust" value= "hand"> Hand Tossed </label><br> Or <label for="email" >Email: </label> <input type="text" name="custemail" id= "email"> 18

Fieldset and Legend Elements The Fieldset Element Container tag Creates a visual group of form elements on a web page The Legend Element Container tag Creates a text label within the fieldset <fieldset><legend>customer Information</legend> <label>name: <input type="text" name= name" id="name"></label> <br><br> <label>email: <input type="text" name="email" id="email"></label> </fieldset> 19

Formatting Aligned label, text box, and button controls

The HTML for the form <label for="firstname">first name:</label> <input type="text" name="firstname" id="firstname" autofocus><br> <label for="lastname">last name:</label> <input type="text" name="lastname" id="lastname"><br> <label for="address">address:</label> <input type="text" name="address" id="address"><br> <label for="city">city:</label> <input type="text" name="city" id="city"><br> <label for="state">state:</label> <input type="text" name="state" id="state"><br> <label for="zip">zip code:</label> <input type="text" name="zip" id="zip"><br> <input type="submit" name="register" id="button" value="register"> <input type="reset" name="reset" id="reset" value="reset">

The CSS for the controls label { float: left; width: 5em; text-align: right;} input { margin-left: 1em; margin-bottom:.5em;} #button { margin-left: 7em;}

HTML5 HTML 5 will support several new input types such as: Color, date, email, etc. Check the following site for browser compatibilities: https://www.w3schools.com/html/html_form_elements.asp