Using JavaScript in FORMs Fort Collins, CO Copyright © XTR Systems, LLC Learning to Use JavaScript in HTML FORMs Instructor: Joseph DiVerdi, Ph.D., MBA.

Slides:



Advertisements
Similar presentations
JavaScript Forms Form Validation Cookies. What JavaScript can do  Control document appearance and content  Control the browser  Interact with user.
Advertisements

Copyright 2007, Information Builders. Slide 1 Implementing On-Click Functionality With the HTML Layout Painter Larry J Braun Education Specialist June,
Introduction to Web Site Development Steven Emory Department of Computer Science California State University, Los Angeles Lecture 8: JavaScript I.
JavaScript 101 Lesson 5: Introduction to Events. Lesson Topics Event driven programming Events and event handlers The onClick event handler for hyperlinks.
Introduction to JavaScript Form Verification - Fort Collins, CO Copyright © XTR Systems, LLC Verifying Submitted Form Data with JavaScript Instructor:
Lesson 8 Creating Forms with JavaScript
CST JavaScript Validating Form Data with JavaScript.
JavaScript Form Validation
Introduction to JavaScript. JavaScript Facts A scripting language - not compiled but interpreted line by line at run-time. Platform independent. It is.
Chapter 6: Forms JavaScript - Introductory. Previewing the Product Registration Form.
CSC318 – DYNAMIC WEB APPLICATION DEVELOPMENT
Event Handlers CS101 Introduction to Computing. Learning Goals Learn about event handlers Determine how events are useful in JavaScript Discover where.
Using Embedded JavaScript Fort Collins, CO Copyright © XTR Systems, LLC Embedding JavaScript In HTML Instructor: Joseph DiVerdi, Ph.D., MBA.
CSU - DCE Internet Security... Privacy Overview - Fort Collins, CO Copyright © XTR Systems, LLC Setting Up & Using a Site Security Policy Instructor:
Understanding Linux Directories Fort Collins, CO Copyright © XTR Systems, LLC Understanding the Linux Directory Structure Instructor: Joseph DiVerdi, Ph.D.,
CSU - DCE Advanced Perl CGI Operation - Fort Collins, CO Copyright © XTR Systems, LLC Introduction to the Common Gateway Interface (CGI) on the.
TUTORIAL 10: PROGRAMMING WITH JAVASCRIPT Session 3.
CSU - DCE Webmaster I HTML - Forms - Fort Collins, CO Copyright © XTR Systems, LLC Designing Web Sites using HTML - Introduction to Forms Instructor:
Faculty of Sciences and Social Sciences HOPE JavaScript Advanced Stewart Blakeway FML
Using Client-Side Scripts to Enhance Web Applications 1.
Extending HTML CPSC 120 Principles of Computer Science April 9, 2012.
Introduction to JavaScript 41 Introduction to Programming the WWW I CMSC Winter 2004 Lecture 17.
JavaScript, Fourth Edition Chapter 5 Validating Form Data with JavaScript.
JavaScript - A Web Script Language Fred Durao
Copyright ©2005  Department of Computer & Information Science Introducing Dialogue Windows.
JavaScript Adding active content to websites. Goals Understand structure of JavaScript Understand rules of coding Add active content to WebPages Add functions.
Fundamentals of WWW Imaging Fort Collins, CO Copyright © XTR Systems, LLC Fundamentals of Web Imaging Instructor: Joseph DiVerdi, Ph.D., MBA.
CSU - DEO Introduction to CGI - Fort Collins, CO Copyright © XTR Systems, LLC Introduction to the Common Gateway Interface (CGI) Instructor: Joseph DiVerdi,
A Little Bit About Cookies Fort Collins, CO Copyright © XTR Systems, LLC A Little Bit About Cookies Instructor: Joseph DiVerdi, Ph.D., M.B.A.
1 JavaScript
Input & Output Functions JavaScript is special from other languages because it can accept input and produce output on the basis of that input in the same.
Internet & World Wide Web How to Program, 5/e. © by Pearson Education, Inc. All Rights Reserved.
Dialog boxes in JavaScript Events in JavaScript – What are they – “Which events are there?” – “How do I register event handlers to an HTML element?” –
Fluency with Information Technology INFO100 and CSE100 Katherine Deibel Katherine Deibel, Fluency in Information Technology1.
Fundamentals of WWW Imaging Fort Collins, CO Copyright © XTR Systems, LLC Fundamentals of Web Imaging Instructor: Joseph DiVerdi, Ph.D., MBA.
Intermediate CGI & CGI.pm Webmaster II - Fort Collins, CO Copyright © XTR Systems, LLC CGI Programming & The CGI.pm Perl Module Instructor: Joseph DiVerdi,
JavaScript, Fourth Edition
Introduction & Overview Introduction to PHP - Fort Collins, CO Copyright © XTR Systems, LLC Introduction to & Overview of PHP Instructor: Joseph DiVerdi,
CSU - DCE Webmaster I HTML - Tables - Fort Collins, CO Copyright © XTR Systems, LLC Designing Web Sites using HTML - Introduction to Tables Instructor:
Creating a Remotely-Hosted Web Site Fort Collins, CO Copyright © XTR Systems, LLC Creating Your First Remotely-Hosted Web Site Instructor: Joseph DiVerdi,
1 JavaScript Part 3. Functions Allow the user to decide when a particular script should be run by the browser in stead of running as long as the page.
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.
Unit 10 – JavaScript Validation Instructor: Brent Presley.
JavaScript Challenges Answers for challenges
Event Handling. Objectives Using event handlers Simulating events Using event-related methods.
Project 8: Reacting to Events Essentials for Design JavaScript Level One Michael Brooks.
Unit 2 — The Exciting World of JavaScript Lesson 7 — Creating Forms with JavaScript.
Introduction to JavaScript Fort Collins, CO Copyright © XTR Systems, LLC Introduction to JavaScript Programming Instructor: Joseph DiVerdi, Ph.D., MBA.
5 th and 4 th ed: some from chapters 9, 12, 13 SY306 Web and Databases for Cyber Operations Slide Set #8: Dynamic HTML.
Event Handling (the right way). A Simple Web Page Events - Summary The web page looks like this:
Webmaster II Introductions - Fort Collins, CO Copyright © XTR Systems, LLC Introduction to Webmaster II Instructor: Joseph DiVerdi, Ph.D., MBA.
CSU - DCE Introduction to CSS CSS Length - Fort Collins, CO Copyright © XTR Systems, LLC Cascading Style Sheets - Specifying Length Instructor:
LESSON : EVENTS AND FORM VALIDATION -JAVASCRIPT. EVENTS CLICK.
CSU - DCE Introduction to CSS CSS URLs - Fort Collins, CO Copyright © XTR Systems, LLC Cascading Style Sheets - Specifying URLs Instructor: Joseph.
Introduction to Server Side Includes Fort Collins, CO Copyright © XTR Systems, LLC Introduction to Server Side Includes (SSI) Instructor: Joseph DiVerdi,
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.
JavaScript 101 Lesson 6: Introduction to Functions.
JavaScript Events. Understanding Events Events add interactivity between the web page and the user Events add interactivity between the web page and the.
CNIT 133 Interactive Web Pags – JavaScript and AJAX Popup Boxes.
WEB SYSTEMS & TECHNOLOGY. Java Script  JavaScript created by Netscape  It is also client side programming  It can be use for client side checks.
JavaScript, Third Edition 1 SELECTION LIST Demo. JavaScript, Third Edition 2 Description This web page will edit the slection to ensure an option was.
CSU - DCE Webmaster I HTML & URLs - Fort Collins, CO Copyright © XTR Systems, LLC Designing Web Sites With HTML - Using Effective Links Instructor:
JavaScript (JS) Basics
Web Programming– UFCFB Lecture 17
Conditionally Confirming a Submit
Web Design and Development
Programming in JavaScript
Programming in JavaScript
Web Programming Ben Blanc
Presentation transcript:

Using JavaScript in FORMs Fort Collins, CO Copyright © XTR Systems, LLC Learning to Use JavaScript in HTML FORMs Instructor: Joseph DiVerdi, Ph.D., MBA

Using JavaScript in FORMs Fort Collins, CO Copyright © XTR Systems, LLC Controlling FORM Submission Using JavaScript It Is Possible to Control Whether or Not a FORM Is Actually Submitted When a Viewer Presses a Submit Button –Good for Teaching How to Use JavaScript –Great for Verifying FORM Contents

Using JavaScript in FORMs Fort Collins, CO Copyright © XTR Systems, LLC Basic FORM Example Create a New File Named alert.html –See the Next Slide for Its Contents

Using JavaScript in FORMs Fort Collins, CO Copyright © XTR Systems, LLC Basic HTML FORM Disk Cleaning Example

Using JavaScript in FORMs Fort Collins, CO Copyright © XTR Systems, LLC Alert Window Example Displaying an Alert Window –Is a Defined Function In JavaScript Add Alert Window Code to Example –It Is Tightly Integrated into HTML Uses HTML Event Handler ONCLICK –Executed When Viewer Presses a Button Use This Code on Your Site Now –See the Next Slide

Using JavaScript in FORMs Fort Collins, CO Copyright © XTR Systems, LLC Alert Window Example Disk Cleaning Example <INPUT TYPE=BUTTON VALUE="Erase Your Hard Disk" ONCLICK="window.alert('You are pretty brave.')" >

Using JavaScript in FORMs Fort Collins, CO Copyright © XTR Systems, LLC Alert Window Example Notice The Lack of the Use of a Contraction in the Alert Window String window.alert('You are pretty brave.') Using a Contraction Requires an Apostrophe –Which Screws up the String Container window.alert('You're pretty brave.') Use an Escaped Apostrophe to Include It –Escape It Using a Preceding Backslash window.alert('You\'re pretty brave.') Use This Code on Your Site Now –Modify alert.html With This Snappy Addition

Using JavaScript in FORMs Fort Collins, CO Copyright © XTR Systems, LLC Alert Window Example Disk Cleaning Example <INPUT TYPE=BUTTON VALUE="Erase Your Hard Disk" ONCLICK="window.alert('You\'re pretty brave.')" >

Using JavaScript in FORMs Fort Collins, CO Copyright © XTR Systems, LLC Confirm Window Example Another Helpful Defined Function Is –Confirm Window Provides the User With Choice of Answers –OK & Cancel Uses HTML Event Handler ONCLICK Use This Code on Your Site Now –Create a new file named confirm.html –Copy alert.html To confirm.html & Modify It –See the Next Slide

Using JavaScript in FORMs Fort Collins, CO Copyright © XTR Systems, LLC Confirm Window Example Disk Cleaning Example <INPUT TYPE=BUTTON VALUE="Erase Your Hard Disk" ONCLICK="window.confirm('You\'re pretty brave.')" >

Using JavaScript in FORMs Fort Collins, CO Copyright © XTR Systems, LLC Useful Confirm Window Example Doesn't Utilize Viewer's Response –Nice of Us to Ask Anyway Let's Set Up To Make Use Of The Response Use This Code on Your Site Now –Create a new file named use_confirm.html –See the Next Slide

Using JavaScript in FORMs Fort Collins, CO Copyright © XTR Systems, LLC Useful Confirm Window Send Example Test This With Your Browser –You Should See A Security-Minded Pop-Up Window –Don't Send The

Using JavaScript in FORMs Fort Collins, CO Copyright © XTR Systems, LLC Useful Confirm Window Now Add Event Handler & JavaScript To Control Browser Use This Code on Your Site Now –Use use_confirm.html –See the Next Slide

Using JavaScript in FORMs Fort Collins, CO Copyright © XTR Systems, LLC Useful Confirm Window Send Example <FORM ONSUBMIT="return false"> Test This With Your Browser –It Should Never Send

Using JavaScript in FORMs Fort Collins, CO Copyright © XTR Systems, LLC Useful Confirm Window Send Example <FORM ONSUBMIT="return true"> Test This With Your Browser –It Should Always Send –Don't Send The

Using JavaScript in FORMs Fort Collins, CO Copyright © XTR Systems, LLC Confirm Window Example window.confirm Function Returns a Value –Dependent on Viewer's Response OK returns true Cancel returns false Use Function Result To Control Browser Use This Code on Your Site Now –Use use_confirm.html –See the Next Slide

Using JavaScript in FORMs Fort Collins, CO Copyright © XTR Systems, LLC Useful Confirm Window Send Example <FORM ONSUBMIT="return window.confirm('Are you sure?')" >