HTML Forms Internet Technology.

Slides:



Advertisements
Similar presentations
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?
Advertisements

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.
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.
Forms. Form An HTML form is a section of a document containing normal content, special elements called controls (checkboxes, radio buttons, buttons, etc.),
Web Development & Design Foundations with XHTML Chapter 9 Key Concepts.
Chapter 10 Form Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D 1.
1 Web Developer & Design Foundations with XHTML Chapter 6 Key Concepts.
HTML B OOT C AMP Chapter 9 Forms Kirkwood Continuing Education © Copyright 2015, Fred McClurg All Rights Reserved.
4-Sep-15 HTML Forms Mrs. Goins Web Design Class. Parts of a Web Form A Form is an area that can contain Form Control/Elements. Each piece of information.
Building the User Interface by Using HTML5: Organization, Input, and Validation Lesson 3.
1 Creating Web Forms in HTML Web forms collect information from customers Web forms include different control elements including: –Input boxes –Selection.
1 HTML References: A HTML Tutorial: /HTMLPrimer.html
 2008 Pearson Education, Inc. All rights reserved Introduction to XHTML.
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.
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.
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.
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,
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.
©SoftMooreSlide 1 Introduction to HTML: Forms ©SoftMooreSlide 2 Forms Forms provide a simple mechanism for collecting user data and submitting it to.
Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
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.
HTML Structure II (Form) WEEK 2.2. Contents Table Form.
2440: 141 Web Site Administration Web Forms Instructor: Joseph Nattey.
Chapter 2 Markup Language By : Madam Hazwani binti Rahmat
Tutorial 6 Working with Web Forms
HTML HTML5 InfoTech Seminar.
Advanced HTML Tags:.
Web Development Part 2.
HTML Basics (Part-3).
Web Systems & Technologies
CHAPTER 2 MARKUP LANGUAGE
HTML 5.
Client-Side Internet and Web Programming
Making your HTML Page Interactive
How to Write Web Forms By Mimi Opkins.
CS3220 Web and Internet Programming HTML Tables and Forms
Forms Web Design Ms. Olifer.
PPT By:Gaurav Jaiswal Singsys Pte. Ltd.
>> More on HTML Forms
Introduction to Web programming
FORMS Explained By: Sarbjit Kaur.
HTML IV (Forms) Robin Burke ECT 270.
Basic XHTML Tables XHTML tables—a frequently used feature that organizes data into rows and columns. Tables are defined with the table element. Table.
Web Programming– UFCFB Lecture 10
IS333: MULTI-TIER APPLICATION DEVELOPMENT
Designing Forms Lesson 10.
Introducing Forms.
HTML: Basic Tags & Form Tags
Introduction to Web programming
Web Development & Design Foundations with H T M L 5
Forms Data Entry and Capture
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.
CS3220 Web and Internet Programming HTML Tables and Forms
HTML Forms Internet Technology.
Basics of Web Design Chapter 10 Form Basics Key Concepts
© Hugh McCabe 2000 Web Authoring Lecture 8
HTML5 - 2 Forms, Frames, Graphics.
Kanida Sinmai HTML Form Kanida Sinmai
Making your HTML Page Interactive
Unit 5 Create Forms.
HTML: Basic Tags & Form Tags
CGS 3066: Web Programming and Design Fall 2019
Presentation transcript:

HTML Forms Internet Technology

HTML Form: Overview What is a HTML form? Why do we need it? 1/17/2019 HTML Form: Overview What is a HTML form? A mechanism to send user input to the web server Why do we need it? To collect data from the user To create interactive & dynamic web content How does it work? HTTP client (i.e., web browser) sends the user input from HTML form to HTTP server (i.e., web server). HTTP server passes the input to a program on the server. The program (e.g. CGI script), processes the input and generates output (e.g., HTML). HTTP server send the program output back to HTTP client. Internet Technology

Static vs. Dynamic Web Content 1/17/2019 Static vs. Dynamic Web Content Static Web Content Dynamic Web Content Client requests a web page Server returns file HTTP client HTTP server Server passes form input to CGI program Client send form input to server (& requests a CGI program) CGI Program Server returns the CGI output CGI program processes input, executes its tasks, & generates output (e.g., HTML) HTTP client HTTP server Internet Technology

Dynamic/Interactive Web 1/17/2019 Dynamic/Interactive Web 4a. Server passes form input to CGI program 4b. CGI runs & generates output 4c. Server sends CGI output to the browser 3. Browser sends form input to server & requests a CGI program 1. User loads a webpage with a form in a Web browser 2. User fills out a form & hits “SUBMIT” button 5. Brower displays CGI output for the user to see When CGI script “processes” the user input, it may to many things before generating output: send emails to people put data in a file puts data in a database etc. Example: http://widit.knu.ac.kr/~kiyang/share/form.htm Internet Technology

1/17/2019 HTML Form: Elements HTML form is created using <form> </form> tags All form elements are contained within <form> </form> tags <form method=“get”> specifies how data will be passed to server <form action=“CGI program”> specifies which CGI program will be run Types of Form Element Input Element text, password, radio, checkbox, reset, submit Textarea Element multi-rowed text boxes Select Element scrollable, pop-up or pop-down menus Tag Syntax TYPE attribute specifies the type of element Each input value should have a NAME attribute Otherwise, CGI won’t know which input value is associated with which field e.g., <input type=“text” name=“userID”> Internet Technology

HTML Form: Input Elements 1/17/2019 HTML Form: Input Elements Text Field Defines a one-line input field that a user can enter text into <form> First name: <input type="text" name="firstname“><br> Last name: <input type="text" name="lastname“> </form> Password Field Defines a password field that will be masked (data won’t display) <form> Password: <input type=“password" name=“pw”> </form> Radio Field Defines a radio button, where user can make only one selection (from radio buttons with the same name) VALUE attribute can be used to pass data specified by its value to the server <form> <input type="radio" name="sex" value="male”> Male<br> <input type="radio" name="sex" value="female”> Female </form> Internet Technology

HTML Form: Input Elements 1/17/2019 HTML Form: Input Elements Checkbox Field Defines a checkbox, where user can make multiple selections (from checkboxes with the same name) <form> <input type="checkbox" name="vehicle" value="Bike”> I have a bike<br> <input type="checkbox" name="vehicle" value="Car”> I have a car  </form> Submit Field Defines a submit button that will send form data to server VALUE attribute determines the text shown on the button <form action=“username.cgi” method=“get”> Username: <input type="text" name="user”> <input type="submit" value="Submit”> </form> Reset Field Clears all form fields (usually used along with SUBMIT) <input type="submit" value="Submit”> <input type=“reset" value=“Clear”> Internet Technology

HTML Form: Other Elements 1/17/2019 HTML Form: Other Elements Select Field Creates a dropdown list, from which user can make selections <form> <select name="cars"> <option value="volvo">Volvo</option> <option value="saab">Saab</option> <option value="fiat">Fiat</option> <option value="audi">Audi</option> </select>   </form> Textarea Field Creates a multi-line text input box ROWS & COLS attributes determines the size of the text box Text between <textarea> and </textarea> will show up in the box. <textarea rows=“10” cols=“30”> The cat was playing in the garden. </textarea> Example: http://widit.knu.ac.kr/~kiyang/share/form.htm Internet Technology

Google Forms A free online form application by Google A component of Google Docs Enables the creation of online survey via web browser Form can be emailed to distribute the survey The survey data is collected on the Google server Automatically summarized and displayed using Google Charts API Can be saved online (Google Docs) and downloaded in a spreadsheet. Class Survey Example Google Form HTML (w/ CGI, Bootstrap, & Google Charts) Internet Technology

HTML HTML5 Internet Technology

HTML5: Overview Removed Added <!DOCTYPE html> 1/17/2019 HTML5: Overview Year Event By 1989 World Wide Web Tim Berners Lee 1991 HTML 1 (basic tags) 1995 HTML 2 (forms support) HTML Working Group 1997 HTML 3 (browser extensions) W3C 1999 HTML 4 (frames) 2000 XHTML (strict HTML) 2008 HTML 5 draft WHATWG 2014 HTML 5 <!DOCTYPE html> <html lang=“kr”> <head> <meta charset=“utf-8”> </head> <body> …. </body> </html> Added Multimedia Support Semantic Elements Form Types/Attributes <audio> <video> <svg> <canvas> <header> <footer> <article> <section> Number Date/Time Range min/max Removed Tags Support <center> <font> <strike> Frames Internet Technology

HTML5: Multimedia Audio Video <audio  controls=“controls”>   <source  src=“song.mp3"  type=“audio/mpeg">   <source  src=“song.ogg"  type=“audio/ogg"> Your browser does not support the video element. </video> Video <video  width=“600” controls=“controls”>   <source  src=“movie.mp4"  type=“video/mpeg">   <source  src=“movie.ogg"  type=“video/ogg"> <track src=“movie_kr.vtt” kind=“subtitles” srclang=“kr” label=“Korean”> <track src=“movie_en.vtt” kind=“subtitles” srclang=“en” label=“English”> Your browser does not support the video element. </video> Example: http://widit2.knu.ac.kr/~kiyang/share/html/media.htm Internet Technology

HTML5: Semantic Elements <header> Introductory content for a document/section <nav> Navigation Links <section> Thematic grouping of content (e.g., chapters) <article> Independent, self-contained content (e.g., forum/blog/ post) <aside> Sidebar content <footer> Footer for a document/section <figure> Caption for an image <img src=‘picture.jpg’> <figcaption>Fig. 1 </figcaption> </figure> Why use Semantic Elements? Easier for Web applications (e.g., search engines) to identify content  For Semantic Web, Web 3.0 Internet Technology

HTML5: Form Input Types Number Date Time Color Range Email URL Search Numeric input Date Date input  date picker Time Time input  time picker Color Color input  color picker Range Input range  slider control Email Email address  automatic validation (checks for @) URL URL address  automatic validation (checks for http://) Search Search field  ‘X’ to clear input Attributes autocomplete Autocomplete based on previous entry min/max Minimum/Maximum input value multiple Enable multiple input values pattern Specify a regular expression for input validation Internet Technology