JavaScript Forms Adding User Input.

Slides:



Advertisements
Similar presentations
Ch3: Introduction to HTML5 part 2 Dr. Abdullah Almutairi ISC 340 Fall 2014.
Advertisements

Video, audio, embed, iframe, HTML Form
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.
Tutorial 6 Forms Section A - Working with Forms in JavaScript.
HTML Tables and Forms Creating Web Pages with HTML CIS 133 Web Programming Concepts 1.
ECA 228 Internet/Intranet Design I Forms. ECA 228 Internet/Intranet Design I Forms forms are a way for a user to communicate with you – text fields –
  Just another way to collect pieces together (like div, section)  Anything can be in there  Formatting just like all other elements.
HTML F ORMS. F ORMS HTML forms are used to pass data to a server. An HTML form can contain input elements like text fields, checkboxes, radio-buttons,
User Interface Design using jQuery Mobile CIS 136 Building Mobile Apps 1.
Web Development & Design Foundations with XHTML Chapter 9 Key Concepts.
Chapter 10 Form Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D 1.
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.
HTML Forms – Interactive HTML – Web 2.0. HTML – New types for input – Degrades gracefully for browsers that do not support the html 5 input types
HTML Forms What is a form.
1 Creating Web Forms in HTML Web forms collect information from customers Web forms include different control elements including: –Input boxes –Selection.
Neal Stublen Improvements  New form elements  Assist with validation  Consistency across sites  Changes reduce the need for common.
SERVER web page repository WEB PAGE instructions stores information and instructions BROWSER retrieves web page and follows instructions Server Web Server.
Week 10.  Form controls  Parent containing element for other form control elements  Requires method and action attributes to process the information.
Suzanne J. Sultan Javascript Lecture 2. Suzanne J. Sultan function What is a function> Types of functions:  Function with no parameters  Function with.
CSC 2720 Building Web Applications HTML Forms. Introduction  HTML forms are used to collect user input.  The collected input is typically sent to a.
HTML Forms.
Web Development & Design Foundations with XHTML Chapter 9 Key Concepts.
1 © Netskills Quality Internet Training, University of Newcastle HTML Forms © Netskills, Quality Internet Training, University of Newcastle Netskills is.
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.
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.
  Just another way to collect pieces together (like div, section)  Anything can be in there  Formatting just like all other elements  Always name.
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.
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.
Fluency with Information Technology INFO100 and CSE100 Katherine Deibel Katherine Deibel, Fluency in Information Technology1.
Web Technologies Lecture 3 Web forms. HTML5 forms A component of a webpage that has form controls – Text fields – Buttons – Checkboxes – Range controls.
+ 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.
FORMS How to collect information f XX rom visitors Different kinds of form controls New HTML5 form controls.
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring Forms, HTML5 layout.
Creating Forms on a Web Page. 2 Introduction  Forms allow Web developers to collect visitor feedback  Forms create an environment that invites people.
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.
HTML Tutorial. What is HTML HTML is a markup language for describing web documents (web pages) HTML documents are described by HTML tags Each HTML tag.
HTML Elements: Forms and Controls Chapter 9 B. Ramamurthy.
HTML FORM. Form HTML Forms are used to select different kinds of user input. HTML forms are used to pass data to a server. A form can contain input elements.
Lesson 5 Introduction to HTML Forms. Lesson 5 Forms A form is an area that can contain form elements. Form elements are elements that allow the user to.
Unit 4 Working with data. Form Element HTML forms are used to pass data to a server. A form can contain input elements like text fields, checkboxes, radio-buttons,
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.
XHTML Forms.
Advanced HTML Tags:.
CS3220 Web and Internet Programming HTML Tables and Forms
Forms Web Design Ms. Olifer.
HTML Forms Pat Morin COMP 2405.
>> More on HTML Forms
Basic XHTML Tables XHTML tables—a frequently used feature that organizes data into rows and columns. Tables are defined with the table element. Table.
HTML Forms CSC 102 Lecture.
Retrieving information from forms
>> Form Data Retrieval in JavaScript
JavaScript Forms Adding User Input.
Validation and Building Small Apps
IS333: MULTI-TIER APPLICATION DEVELOPMENT
Introducing Forms.
Web Systems Development (CSC-215)
Creating Form Elements
Web Development & Design Foundations with H T M L 5
Forms Data Entry and Capture
Forms, cont’d.
Writing to a PAGE.
HTML5 - 2 Forms, Frames, Graphics.
Writing to a PAGE.
Presentation transcript:

JavaScript Forms Adding User Input

Input Forms

User Input: Forms <form name=“formname”> Just another way to collect pieces together (like div, section) Anything can be in there Formatting just like all other elements Always name forms

User input But we’d also like to let users give us information Request input <input type="text" name="name"> Lots of types Use name to identify the element

Naming Elements Reference value through CONTEXT: <form name=form-name> <label> Label: <input type=text name=“field-name” /> </label> </form> Reference value through CONTEXT: form-name.field-name.value

Retrieving the value form-name.field-name.value Note that the first 2 parts of this are just normal selector notation (like you use in css) The .value is to be used exactly and says to use that tag’s value (Note this is only the first and simplest way to access information)

Button or input type=button? Always put onclick first in either case Generally, use input in form, button outside Button tag Always set attribute type button: general purpose reset: clear all fields in the form

Input attributes

Labeling Elements <form> <label> Label: <input type=text></input> </label> </form> No formatting, but accessibility gains

Default Values <form> <label> Label: <input type=text value=“COMP” /> </label> </form> Sets default value, but can be changed

Hint Text Gives text but never passed as value <form> <label> Label: <input type=text placeholder=“department” /> </label> </form> Gives text but never passed as value

Other Input Types

Many Element Types button checkbox color date  datetime  datetime-local  email  file image month  number  password radio range  reset search tel text time  url week

Select Drop-down list Supports autocomplete

Select Example <form> <select> <option>Internet Explorer</option> <option>Firefox </option> <option>Chrome </option> <option>Opera </option> <option>Safari </option> </select> </form>

Another CSS Capability

Selecting based on attributes tag[attribute=“value’] Formatting only applies to tages with that attribute value Tag.classname is same as Tag[class=“classname”] Other options (rarely used) tag[attribute]: if the attribute is used Not Begins with Ends with … w3schools