CGS 3066: Web Programming and Design Fall 2019

Slides:



Advertisements
Similar presentations
Images, Tables, lists, blocks, layout, forms, iframes
Advertisements

>> Introduction to HTML: Forms. Introduction to HTML 5 Important HTML Tags HTML tags and attributes Images Hyperlinks Lists –{ordered | unordered | definition}
Video, audio, embed, iframe, HTML Form
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.
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.
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic Table, Forms, Metatags and Frames.
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.
Tutorial #9 – Creating Forms. Tutorial #8 Review – Tables Borders (table, gridlines), Border-collapse: collapse; empty-cells: show; and rowspan, colspan.
1 HTML References: A HTML Tutorial: /HTMLPrimer.html
CSC 2720 Building Web Applications HTML Forms. Introduction  HTML forms are used to collect user input.  The collected input is typically sent to a.
 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.
Web Development & Design Foundations with XHTML Chapter 9 Key Concepts.
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.
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. Slide 2 Forms (Introduction) The purpose of input forms Organizing forms with a and Using different element types to get user input A brief.
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.
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.
+ 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.
HTML Forms.
Week 10: HTML Forms HNDIT11062 – Web Development.
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring Forms, HTML5 layout.
HTML (Advanced) -forms, iframe, audio, video. Outline – Forms – iFrames – Audio/Video.
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring Forms, HTML5 layout.
Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
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.
Chapter 2 Markup Language By : Madam Hazwani binti Rahmat
Tutorial 6 Working with Web Forms
Advanced HTML Tags:.
Web Development Part 2.
Client-Side Internet and Web Programming
Making your HTML Page Interactive
Objectives Design a form Create a form Create text fields
CS3220 Web and Internet Programming HTML Tables and Forms
Forms Web Design Ms. Olifer.
HTML Forms Pat Morin COMP 2405.
FORMS IN HTML.
>> More on HTML Forms
Introduction to Web programming
Lists-Tables-Frames Unit - I.
FORMS Explained By: Sarbjit Kaur.
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
ARUSHA TECHNICAL COLLEGE WEB DESIGN(html forms)
HTML/XHTML Forms 18-Sep-18.
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
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.
HTML Forms Internet Technology.
HTML Forms Internet Technology.
Principles of Web Design 5th Edition
Basics of Web Design Chapter 10 Form Basics Key Concepts
© Hugh McCabe 2000 Web Authoring Lecture 8
HTML5 - 2 Forms, Frames, Graphics.
Web Client Side Technologies Raneem Qaddoura
Kanida Sinmai HTML Form Kanida Sinmai
Making your HTML Page Interactive
Form Design & Validation
HTML: Basic Tags & Form Tags
Presentation transcript:

CGS 3066: Web Programming and Design Fall 2019 Forms , HTML5 layout Department of Computer Science, Florida State University

HTML Forms One of the main points of interaction between a user and a web site Used to collect different kinds of user input/data and pass them to the server. Primarily contains input controls such as text fields, checkboxes, radio-buttons, submit buttons,drop-down lists etc. Also non-input elements(e.g. labels, fieldsets) for presentation HTML tag: <form> ..</form>

HTML Forms(contd) Forms are submitted for processing using the submit button input Input controls should have their name attributes set form data submitted in (name, value) pair

Form input controls <input> The <input> element is the most important form element. The <input> element can be displayed in several ways, depending on the type attribute. Here are some examples: Type Description <input type="text"> Defines a one-line text input field <input type="radio"> Defines a radio button (for selecting one of many choices) <input type="submit"> Defines a submit button (for submitting the form) <input type="checkbox"> Defines a checkbox

<input type=“text”> <input type="text"> defines a one-line text input field: <form> First name:<br> <input type="text" name="firstname"><br> Last name:<br> <input type="text" name="lastname"> </form>

<input type=“password”> <input type="password"> defines a password field : The characters in a password field are masked (shown as asterisks or circles). <form> User name:<br> <input type="text" name="username"><br> User password:<br> <input type="password" name="psw"> </form>

<input type=“submit”> <input type=“submit"> defines a button for submitting form data to a form-handler : The form-handler is typically a server page with a script for processing input data. We will learn this later when we talk about back-end code. <form action="/action_page.php"> First name:<br> <input type="text" name="firstname" value="Mickey"><br> Last name:<br> <input type="text" name="lastname" value="Mouse"><br><br> <input type="submit" value="Submit"> </form>

<input type=“reset”> <input type=“reset"> defines a reset button that will reset all form values to their default values: <form action="/action_page.php"> First name:<br> <input type="text" name="firstname" value="Mickey"><br> Last name:<br> <input type="text" name="lastname" value="Mouse"><br><br> <input type="submit" value="Submit"> <input type="reset"> </form>

<input type=“radio”> <input type=“radio"> defines a radio button: Radio buttons let a user select ONLY ONE of a limited number of choices. <form> <input type="radio" name="gender" value="male" checked> Male<br> <input type="radio" name="gender" value="female"> Female<br> <input type="radio" name="gender" value="other"> Other </form>

<input type=“checkbox”> <input type=“checkbox"> defines a checkbox: Checkboxes let a user select ZERO or MORE options of a limited number of choices. <form> <input type="checkbox" name="vehicle1" value="Bike"> I have a bike<br> <input type="checkbox" name="vehicle2" value="Car"> I have a car </form>

The <select> element (dropdown list) The <select> element defines a drop-down list The <option> elements defines an option that can be selected. By default, the first item in the drop-down list is selected. <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>

The <select> element (dropdown list) To define a pre-selected option, add the selected attribute to the option. <form> <select name="cars"> <option value="volvo">Volvo</option> <option value="saab">Saab</option> <option value="fiat" selected>Fiat</option> <option value="audi">Audi</option> </select> </form>

The <select> element (dropdown list) Use the multiple attribute to allow the user to select more than one value: Use the size attribute to specify the number of visible values. <form> <select name="cars" size="3" multiple> <option value="volvo">Volvo</option> <option value="saab">Saab</option> <option value="fiat">Fiat</option> <option value="audi">Audi</option> </select> </form>

The <textarea> element The <textarea> element defines a multi-line input field (a text area) The rows attribute specifies the visible number of lines in a text area. The cols attribute specifies the visible width of a text area. <form> <textarea name="message" rows="10" cols="30"> The cat was playing in the garden. </textarea> </form> You can also define the size of the text area by using CSS properties width and height

<input> Attributes – value The value attribute specifies the initial value for an input field <form> First name:<br> <input type="text" name="firstname" value ="John"> <br> Last name:<br> <input type="text" name="lastname"> </form>

<input> Attributes – readonly The readonly attribute specifies that the input field is read only (cannot be changed): <form> First name:<br> <input type="text" name="firstname" value ="John" readonly> <br> Last name:<br> <input type="text" name="lastname"> </form>

<input> Attributes – disabled The disabled attribute specifies that the input field is disabled. A disabled input field is unusable and un-clickable, and its value will not be sent when submitting the form <form> First name:<br> <input type="text" name="firstname" value ="John" disabled> <br> Last name:<br> <input type="text" name="lastname"> </form>

<input> Attributes – size The size attribute specifies the size (in characters) for the input field <form> First name:<br> <input type="text" name="firstname" value="John" size="40"> <br>Last name:<br> <input type="text" name="lastname"> </form>

<input> Attributes – maxlength The maxlength attribute specifies the maximum allowed length for the input field: With a maxlength attribute, the input field will not accept more than the allowed number of characters. The maxlength attribute does not provide any feedback. If you want to alert the user, you must write JavaScript code. <form> First name:<br> <input type="text" name="firstname" maxlength="10"> <br>Last name:<br> <input type="text" name="lastname"> </form>

HTML5 input types HTML5 introduces several new input types Browser support varies. Unsupported input types shown as textboxes Try http://robertnyman.com/html5/forms/input-types.html on different browsers color date datetime-local email month number range search tel time url week Source: http://robertnyman.com/

Other Form related tags <textarea>: defines a multi-line text input <select>: defines a drop-down list <option>: defines an option inside a drop-down list(<select>) <optgroup>: groups <option> elements inside a drop-down list(<select>) <fieldset>: Group related elements in a form. <legend> defines caption of a <fieldset>. <label>: defines a label for an <input> element. Uses for attribute to associate to any specific <input> Example: <label for="lastname">Last Name</label> <input type="text" name="lastname" />

Grouping with <fieldset> and <legend> <form action="/action_page.php">   <fieldset>     <legend>Personal information:</legend>     First name:<br>     <input type="text" name="firstname" value="Mickey"> <br>Last name:<br>         <input type="text" name="lastname" value="Mouse"><br><br>     <input type="submit" value="Submit">   </fieldset> </form>

HTML Form attributes action: Specifies the URL where form data is to be submitted. Typically another server page that can process form data If not set, form data is submitted to a new copy of the submitting page itself method: [get/post] In get method, form data are appended to the destination URL(e.g. Youtube search query) In post method, form data put inside the body of the HTTP request  autocomplete : [on/off] *Submit buttons have action and formmethod attributes, can respectively override action and method attributes of the form containing it

HTML Layouts Layouts were created using the <div> tag in older versions of HTML. Partitions the page into columns/blocks, each used for a specific purpose. <div> was paired with CSS styles using the id attributes. Layouts can also be created using tables, but it is not recommended. HTML5 introduces new semantic elements to handle layouts.

HTML5 Layouts Source: http://www.w3schools.com/html/html_layout.asp

HTML5 Semantic Elements A semantic element clearly describes its meaning to both the browser and the developer. All the layout tags in the previous slide are semantic elements. Other semantic elements include: <figure>: Specifies self-contained content, like illustrations, diagrams, photos, code listings, etc. <figcaption>: Defines a caption for a <figure> element. <main>: Specifies the main content of a document. <mark>: Defines marked/highlighted text. <time>: Defines a date/time.

Embedding Web Content in HTML An inline frame is used to embed a web page within a web page. Use src attribute to set the URL of the page to embed, height and width to set dimensions <iframe src=“http://www.cs.fsu.edu” width=“600" height=“600“ name="iframe1"> </iframe> An iframe can be used as the target frame for a link. <a href="http://www.w3.org" target="iframe1"> World Wide Web Consortium</a> <!-- Upon click on hyperlink, loads content from “http://www.w3.org” into the target iframe -->

Embedding audio/video in HTML <video>: Defines a video or movie. <source>: Defines multiple media resources for media elements, such as <video> and <audio> <video width=“480" height=“360" autoplay controls> <source src="movie.mp4" type="video/mp4"> <source src="movie.ogg" type="video/ogg"> </video>

Embedding audio/video in HTML(contd.) Video plays automatically when autoplay attribute is present controls attribute adds video controls(e.g. play/pause, volume etc) Multiple <source> elements can link to different video files. The browser will use the first recognized format. <audio> works in a similar way as <video> tags

HTML5 supported audio/video types Supported type attribute for <video>: video/webm video/ogg video/mp4 Supported type attribute for <audio>: audio/webm audio/ogg audio/mp4 audio/wav

HTML <embed> element Used to embed interactive content from external application (e.g. Flash animations, Java Applets) on HTML document Attributes: src, height, width, type Example: <embed src="catgame.swf“ type=“application/x-shockwave-flash” height=“200” width=“200” quality="high"> No end tag Any parameter to the external application is passed as attribute name in <embed>