Fluency with Information Technology INFO100 and CSE100 Katherine Deibel 2012-05-02Katherine Deibel, Fluency in Information Technology1.

Slides:



Advertisements
Similar presentations
23-Aug-14 HTML/XHTML Forms. 2 What are forms? is just another kind of XHTML/HTML tag Forms are used to create (rather primitive) GUIs on Web pages Usually.
Advertisements

24-Aug-14 HTML Forms. 2 What are forms? is just another kind of HTML tag HTML forms are used to create (rather primitive) GUIs on Web pages Usually the.
Computer and Communication Fundamental Basic web programming Lecture 8 Rina Zviel-Girshin.
The Web Warrior Guide to Web Design Technologies
SE-2840 Dr. Mark L. Hornick 1 HTML input elements and forms.
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
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Fluency with Information Technology Third Edition by Lawrence Snyder Chapter.
Python and Web Programming
Creating Web Page Forms
Tutorial 6 Forms Section A - Working with Forms in JavaScript.
Inline, Internal, and External FIle
Web Development & Design Foundations with XHTML Chapter 9 Key Concepts.
1 More JavaScript, HTML Forms, CGI Scripts Tom Horton Alfred C. Weaver CS453 Electronic Commerce.
CST JavaScript Validating Form Data with JavaScript.
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 Events Lect 8. 2 Event-driven Pages one popular feature of the Web is its interactive nature e.g., you click on buttons to make windows appear e.g.,
1 Web Developer & Design Foundations with XHTML Chapter 6 Key Concepts.
1 Creating Web Forms in HTML Web forms collect information from customers Web forms include different control elements including: –Input boxes –Selection.
1 Forms A form is the usual way that information is gotten from a browser to a server –HTML has tags to create a collection of objects that implement this.
Chapter 5 Java Script And Forms JavaScript, Third Edition.
© 2011 Delmar, Cengage Learning Chapter 9 Collecting Data with Forms.
Javascript and Basic Programming Concepts. What is a Program? A program is a specific set of instructions written in a computer language to perform a.
XHTML Introductory1 Forms Chapter 7. XHTML Introductory2 Objectives In this chapter, you will: Study elements Learn about input fields Use the element.
Event Handlers CS101 Introduction to Computing. Learning Goals Learn about event handlers Determine how events are useful in JavaScript Discover where.
The Bean Counter: A JavaScript Program
Copyright ©2005  Department of Computer & Information Science Introducing DHTML & DOM: JavaScript & Forms.
SERVER web page repository WEB PAGE instructions stores information and instructions BROWSER retrieves web page and follows instructions Server Web Server.
Suzanne J. Sultan Javascript Lecture 2. Suzanne J. Sultan function What is a function> Types of functions:  Function with no parameters  Function with.
Tutorial 7 Creating Forms. Objectives Session 7.1 – Create an HTML form – Insert fields for text – Add labels for form elements – Create radio buttons.
Lesson13. JavaScript JavaScript is an interpreted language, designed to function within a web browser. It can also be used on the server.
Fluency with Information Technology INFO100 and CSE100 Katherine Deibel Katherine Deibel, Fluency in Information Technology1.
Extending HTML CPSC 120 Principles of Computer Science April 9, 2012.
Chapter 8 Collecting Data with Forms. Chapter 8 Lessons Introduction 1.Plan and create a form 2.Edit and format a form 3.Work with form objects 4.Test.
 Whether using paper forms or forms on the web, forms are used for gathering information. User enter information into designated areas, or fields. Forms.
HTML Forms.
Forms and Server Side Includes. What are Forms? Forms are used to get user input We’ve all used them before. For example, ever had to sign up for courses.
LOGO FORMs in HTML CHAPTER 5 Eastern Mediterranean University School of Computing and Technology Department of Information Technology ITEC229 Client-Side.
JavaScript - A Web Script Language Fred Durao
JavaScript, jQuery, and Mashups Incorporating JavaScript, jQuery, and other Mashups into existing pages.
Button and Textbox. Input  Input objects are used to obtain input from the user viewing the webpage. They allow the user to interact with the Web. 
Creating Web Page Forms. Introducing Web Forms Web forms collect information from users Web forms include different control elements including: –Input.
Lecture 10 JavaScript: DOM and Dynamic HTML Boriana Koleva Room: C54
HTML Form Widgets. Review: HTML Forms HTML forms are used to create web pages that accept user input Forms allow the user to communicate information back.
Web Development 101 Presented by John Valance
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.
Sahar Mosleh California State University San MarcosPage 1 JavaScript Basic.
ECA 225 Applied Interactive Programming1 ECA 225 Applied Online Programming basics.
Fluency with Information Technology INFO100 and CSE100 Katherine Deibel Katherine Deibel, Fluency in Information Technology1.
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.
IS2802 Introduction to Multimedia Applications for Business Lecture 3: JavaScript and Functions Rob Gleasure
1 CSC160 Chapter 7: Events and Event Handlers. 2 Outline Event and event handlers onClick event handler onMouseOver event handler onMouseOut event handler.
JavaScript Challenges Answers for challenges
Event Handling. Objectives Using event handlers Simulating events Using event-related methods.
WDMD 170 – UW Stevens Point 1 WDMD 170 Internet Languages eLesson: Variables, Functions and Events (NON-Audio version) © Dr. David C. Gibbs WDMD.
HTML Forms.
Today’s Announcements` If you have problems with the assignments, don’t be afraid to ask for help Assignment 6 is due and will be graded before the end.
LESSON : EVENTS AND FORM VALIDATION -JAVASCRIPT. EVENTS CLICK.
JavaScript Events Java 4 Understanding Events Events add interactivity between the web page and the user You can think of an event as a trigger that.
CSC 121 Computers and Scientific Thinking Fall Event-Driven Programming.
JavaScript Events. Understanding Events Events add interactivity between the web page and the user Events add interactivity between the web page and the.
JavaScript JavaScript is a programming language that web browsers understand. You can use it to make your web pages interactive by: Responding to user.
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.
HTML Structure II (Form) WEEK 2.2. Contents Table Form.
FORMS Explained By: Jasdeep Kaur. Lecturer, Department of Computer Application, PGG.C.G., Sector: 42, Chandigarh.
Ashima Wadhwa Java Script And Forms. Introduction Forms: –One of the most common Web page elements used with JavaScript –Typical forms you may encounter.
Introduction to.
HTML Forms and User Input
Web Programming and Design
Presentation transcript:

Fluency with Information Technology INFO100 and CSE100 Katherine Deibel Katherine Deibel, Fluency in Information Technology1

 We have used alert() and confirm() to communicate with users  But that is very crude interaction  We can create greater interactivity through JS and XHTML forms  Create buttons, textboxes, and lists  Input, manipulate, and output data Katherine Deibel, Fluency in Information Technology2

 Katherine Deibel, Fluency in Information Technology3

Katherine Deibel, Fluency in Information Technology4 A.10 B.11 C.73 D.37 E.Note of the above

A.10 B.11 C.73 D.37 E.Note of the above Katherine Deibel, Fluency in Information Technology5 Remember, JS uses order of operations when calculating. The first calculation here is the string concatenation.

Katherine Deibel, Fluency in Information Technology6 A.97 B.79 C.42 D.16 E.Over 9000

A.97 B.79 C.42 D.16 E.Over Katherine Deibel, Fluency in Information Technology7 Here, the parentheses take precedence, and the first operation is the addition.

 form a FORM!  Notice that FORM contains different types of widgets  Part of fluency is knowing the names of the various widgets Katherine Deibel, Fluency in Information Technology8

 Form widgets cannot exist on their own and Must be located between  Multiple forms can be on a single page  Place associated widgets in the same form  Easier to use tags to separate individual widgets (see later slides) Katherine Deibel, Fluency in Information Technology9

 The tag is generally invisible to the user  Only a container for the widgets  Can be styled with CSS form { background-color: lightgray; } Katherine Deibel, Fluency in Information Technology10

 Require attribute: action  Tells the browser where the program is that will process the form  JSP file, ASP file, Java App, etc.  We don't need it!  Since it is required, we use the empty string for its specification: Katherine Deibel, Fluency in Information Technology11

 Most form widgets are created by the tag  Text fields  Password fields  Radio buttons  Checkboxes  File chooser  Buttons ●●●● ●●●●● Katherine Deibel, Fluency in Information Technology12

 The tag gives a label to an tag  Clicking on the label gives that widget the current focus  To meet accessibility standards, all inputs (except buttons) require a label  Also true for other form widgets ●●●● ●●●●● Katherine Deibel, Fluency in Information Technology13

 's attributes:  type: kind of input widget (e.g., button)  id: unique identifier for the widget  name: identifier for a group of widgets  value: optional, used only for some types  's attributes  for: the id of the input the tag labels Katherine Deibel, Fluency in Information Technology14

 The tag gives a label to an tag  Clicking on the label gives that widget the current focus  To meet accessibility standards, the 95% rule is that all inputs (except buttons) require a label  Also true for other form widgets ●●●● ●●●●● Katherine Deibel, Fluency in Information Technology15

Katherine Deibel, Fluency in Information Technology16 ●●●● ●●●●● First Name:

 type="text"  Creates a textbox / text field that allows for a single line of text  Default width is 20 characters  type="password"  Creates the same as "text" but characters are hidden (circles, asterisks, etc.) when typed Katherine Deibel, Fluency in Information Technology17

 Requires the value attribute  value should reflect the checkbox's purpose  Use name to associate related checkboxes Katherine Deibel, Fluency in Information Technology18 Cats Dogs

 Radio buttons allow only one option to be selected at a time  Each option gets its own tag and value  Group related radio buttons by name Katherine Deibel, Fluency in Information Technology19 Male Female

 Creates a combined textfield and button to let the user select a local file on the user's computer Katherine Deibel, Fluency in Information Technology20 ●●●● ●●●●● Resume:

 actually offers several types of buttons  reset: clears each widget in the form  submit: sends form data to the location specified at  button: a generic button  We will use only reset and button in this class Katherine Deibel, Fluency in Information Technology21

 All button types require the value attribute  value is the text displayed on the button Katherine Deibel, Fluency in Information Technology22 ●●●● ●●●●●

 The CSS only changed the colors and font-weight  Browsers have default styling for widgets  Note the rounded corners on Submit button  CSS can deactivate the default styles (GRRR!) Katherine Deibel, Fluency in Information Technology23

Katherine Deibel, Fluency in Information Technology24 A.Both input and output operations B.Input operations only C.Output operations only D.Not applicable since it is not a legal tag in XHTML

A.Both input and output operations B.Input operations only C.Output operations only D.Not applicable since it is not a legal tag in XHTML Katherine Deibel, Fluency in Information Technology25 can be used for both input and output:  Getting input from the user typing  Displaying text messages without the annoyance of an alert

Katherine Deibel, Fluency in Information Technology26 ●●●● ●●●●● (border around form) Example Form I NEED THIS JOB! … (border around form)

Adding Events Katherine Deibel, Fluency in Information Technology27

A.Event B.Notification C.Feedback D.Alert Katherine Deibel, Fluency in Information Technology28

 After drawing a page, browsers sit idle waiting for something to happen  When we give input, it cause events  Processing the input is the task of an event handler  Event types  onclick  onchange  onmouseover In the tag an event handler gives the processing needed for the task using JavaScript Katherine Deibel, Fluency in Information Technology29

Katherine Deibel, Fluency in Information Technology30 A.The user right-clicks the mouse B.The user double clicks the mouse C.The user pushes both mouse buttons at the same time D.The user pushes the left mouse button and then the right button in quick succession

 For event handlers like onclick you must  Treat them like attributes:  so you will type: onclick=" … "  Put inside the quotes the operations to be performed when the event happens … this will be standard JavaScript  No script tags required  Follow usual JS rules Katherine Deibel, Fluency in Information Technology31

 onclick is an event that is triggered when a widget is clicked on (as in clicking on a button) <input type="button" value="Hit The button!" onclick="document.forms[0].dataOut.value = 'Ouch!'" /> <input type="button" value="Hit The button!" onclick="document.forms[0].dataOut.value = 'Ouch!'" /> Katherine Deibel, Fluency in Information Technology32

 We use an assignment to change the text box's value <input type="button" value="Hit The button!" onclick="document.forms[0].dataOut.value = 'Ouch!'" /> refers to the current web page refers to the 1 st form says we want to change value in window refers to text window of this name Katherine Deibel, Fluency in Information Technology33

 Linked on Calendar for today  Looked at the HTML and JS for this page and pay attention to the following:  The layout of the 3 text fields and button  The button's use of  How the JS gets the values in the first two text boxes  How JS multiplies the values  How JS puts the product in the last text box Katherine Deibel, Fluency in Information Technology34

 Consider the form and the data stored in  What will trigger the browser to do something  that is the event  When the vent happens, ask yourself: "What should the computer do when that "event happens?"  that is handling the event Katherine Deibel, Fluency in Information Technology35

document.write() Katherine Deibel, Fluency in Information Technology36

 document.write() is a function that puts text into the Web page as it is being created  It works because the browser runs all of the JS before displaying the page, thus allowing JS to create HTML on the fly  Can even put document.write() in a script in the head of a page Katherine Deibel, Fluency in Information Technology37

var school=confirm("Are you a Husky?"); if (school == 1) { document.write(" HUSKIES!!! "); document.bgColor = 'purple'; document.fgColor = 'gold'; } else { document.write(" Cougars.... yay "); document.bgColor = 'red'; document.fgColor = 'white'; } Katherine Deibel, Fluency in Information Technology38

 By deciding before the page is set- up, the whole look and feel can be controlled! Katherine Deibel, Fluency in Information Technology39

 Forms are the basis for interaction on web pages  Events, event handlers, and JavaScript are the means by which the interaction occurs  Lots of options for creating dynamic web pages Katherine Deibel, Fluency in Information Technology40