Scott Marino MSMIS Summer Session 1 - 2001 Web Site Design and Authoring Session 9 Scott Marino.

Slides:



Advertisements
Similar presentations
Tutorial 5 Windows and Frames Section A - Working with Windows.
Advertisements

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?
Essentials for Design JavaScript Level One Michael Brooks
Tutorial 6 Creating a Web Form
JavaScript Forms Form Validation Cookies. What JavaScript can do  Control document appearance and content  Control the browser  Interact with user.
Intermediate Level Course. Text Format The text styles, bold, italics, underlining, superscript and subscript, can be easily added to selected text. Text.
Chapter 7 © 2001 by Addison Wesley Longman, Inc. 1 Chapter 7 Sebesta: Programming the World Wide Web.
XP 1 Designing a Web Site with Frames Using Frames to Display Multiple Web Pages Tutorial 5.
JavaScript Forms Form Validation Cookies CGI Programs.
Tutorial 8 Designing a Web Site with Frames. XP Objectives Explore the uses of frames in a Web site Create a frameset consisting of rows and columns of.
Tutorial 14 Working with Forms and Regular Expressions.
Web Development & Design Foundations with XHTML Chapter 14 Key Concepts.
Create a Web Site with Frames
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 14 Key Concepts 1 Copyright © Terry Felke-Morris.
Chapter 6 Working with Frames.
XP Tutorial 5New Perspectives on HTML, XHTML, and DHTML, Comprehensive 1 Designing a Web Site with Frames Using Frames to Display Multiple Web Pages Tutorial.
Course Textbook: Build Your Own ASP.Net Website: Chapter 2
Form Handling, Validation and Functions. Form Handling Forms are a graphical user interfaces (GUIs) that enables the interaction between users and servers.
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.
JavaScript Form Validation
Building the User Interface by Using HTML5: Organization, Input, and Validation Lesson 3.
_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications1.
Database-Driven Web Sites, Second Edition1 Chapter 8 Processing ASP.NET Web Forms and Working With Server Controls.
Chapter 3 Using Validation Controls. What is a Validation Control? A control that validates the value in another control Renders as an HTML tag with an.
Tutorial 14 Working with Forms and Regular Expressions.
Chapter 5 Java Script And Forms JavaScript, Third Edition.
Chapter 6: Forms JavaScript - Introductory. Previewing the Product Registration Form.
 2003 Prentice Hall, Inc. All rights reserved. CHAPTER 3 JavaScript 1.
Project Four Forms Discuss form processing Describe the difference between client-side and server-side form processing Add a horizontal rule to a Web page.
XP 1 Tutorial 5 Using Frames in a Web Site. XP 2 Tutorial Objectives  Describe the uses of frames in a Web site  Lay out frames within a browser window.
Chapter 2 Developing a Web Page. A web page is composed of two distinct sections: –The head content –The body Creating Head Content and Setting Page Properties.
WEEK 3 AND 4 USING CLIENT-SIDE SCRIPTS TO ENHANCE WEB APPLICATIONS.
JavaScript Part 1.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 14 Key Concepts 1 Copyright © Terry Felke-Morris.
UFCEWT-20-3 Advanced Topics in Web Development Lecture 4 : JavaScript, Browsers & the HTML DOM-API.
CSS Class 7 Add JavaScript to your page Add event handlers Validate a form Open a new window Hide and show elements Swap images Debug JavaScript.
Website Development with Dreamweaver
XP Dreamweaver 8.0 Tutorial 3 1 Adding Text and Formatting Text with CSS Styles.
Lesson13. JavaScript JavaScript is an interpreted language, designed to function within a web browser. It can also be used on the server.
INTRODUCTION TO JAVASCRIPT AND DOM Internet Engineering Spring 2012.
Copyright (c) 2004 Prentice-Hall. All rights reserved. 1 Committed to Shaping the Next Generation of IT Experts. Project 7: Working with Frames Kelly L.
Using Client-Side Scripts to Enhance Web Applications 1.
Introduction to JavaScript 41 Introduction to Programming the WWW I CMSC Winter 2004 Lecture 17.
 2003 Prentice Hall, Inc. All rights reserved. CHAPTER 3 JavaScript 1.
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.
Introduction to HTML Part 3 Chapter 2. Learning Outcomes Identify how to design frames. Explain frames’ attributes. Describe the method on designing forms.
Scott Marino MSMIS Summer Session Web Site Design and Authoring Session 5 and 6 Scott Marino.
XP Tutorial 6 New Perspectives on JavaScript, Comprehensive1 Working with Windows and Frames Enhancing a Web Site with Interactive Windows.
4 Chapter Four Introduction to HTML. 4 Chapter Objectives Learn basic HTML commands Discover how to display graphic image objects in Web pages Create.
JavaScript - A Web Script Language Fred Durao
JavaScript - Basic Concepts Prepared and Presented by Hienvinh Nguyen, Afshin Tiraie.
Introduction to JavaScript CS101 Introduction to Computing.
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.
Scott Marino MSMIS Summer Session Web Site Design and Authoring Session 8 Scott Marino.
XP Tutorial 8 Adding Interactivity with ActionScript.
The Web Wizard’s Guide To JavaScript Chapter 8 Working with Windows and Frames.
Tutorial 3 Adding and Formatting Text with CSS Styles.
The Web Wizard’s Guide To JavaScript Chapter 3 Working with Forms.
©SoftMooreSlide 1 Introduction to HTML: Forms ©SoftMooreSlide 2 Forms Forms provide a simple mechanism for collecting user data and submitting it to.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
HTML Forms.
Writing Your Own Web Page: Using HTML and FrontPage Chapter 10.
Microsoft FrontPage 2003 Illustrated Complete Creating a Frames Page.
1 CSC160 Chapter 1: Introduction to JavaScript Chapter 2: Placing JavaScript in an HTML File.
Tutorial 6 Creating a Web Form
Ashima Wadhwa Java Script And Forms. Introduction Forms: –One of the most common Web page elements used with JavaScript –Typical forms you may encounter.
JavaScript, Sixth Edition
In this session, you will learn to:
The Web Wizard’s Guide To JavaScript
Presentation transcript:

Scott Marino MSMIS Summer Session Web Site Design and Authoring Session 9 Scott Marino

MSMIS Summer Session Topics JavaScript and Frames –JavaScript / Chapter 4 JavaScript and Windows –JavaScript / Chapter 5 JavaScript and Forms –JavaScript / Chapter 6

Scott Marino MSMIS Summer Session JavaScript and Frames Frameset –called “top” or “parent” in the object model –each frame is named

Scott Marino MSMIS Summer Session JavaScript and Frames Breaking out of a frame –If someone links to your site in a frame –Allows you to look at the current page in reference to all pages and replace the current location –if (top.location != self.location) { top.location.replace(self.location) } If the location of the current page is not the top location, use the replace method to place the current page in the top location

Scott Marino MSMIS Summer Session JavaScript and Frames Forcing a page into a frame –If someone links to one of your pages that you intended to be inside a frame –if (top.location == self.location) { top.location.replace(“framesetpage.htm”) } If the location of the current page is the top location, use the replace method to place the frameset page in the top location

Scott Marino MSMIS Summer Session JavaScript and Frames Can use JavaScript to redirect the user to a non- framed version of your site by checking for frame support Can use JavaScript to create dynamic content within frames

Scott Marino MSMIS Summer Session JavaScript and Browser Windows Can use JavaScript to open new browser windows, or to update the content of a window function newWindow() { myWindow = window.open(“myimage.jpg”, “myWin”, “width=n,height=n”) } This function will create a new window object, myWindow, that is named myWin and loads an image into the window

Scott Marino MSMIS Summer Session JavaScript and Browser Windows Other window.open parameters are: –toolbar=yes for the toolbar to display –location=yes for the url to display –scrollbars=yes to display scrollbars –resize=yes to allow the user to resize the window myWindow.focus() –Brings your new window into focus myWindow.blur() –Hides your new window

Scott Marino MSMIS Summer Session JavaScript and Browser Windows Can use JavaScript to write html to the new window myWindow.document.write(‘ …. Can break the document.write into several groups and the dynamically generate content in the

Scott Marino MSMIS Summer Session JavaScript and Browser Windows You can also close the window you opened Should have a myWindow = null in the inside the head to ensure that the object exists –it will be created on page load if (myWindow && !myWindow.closed) { myWindow.close() } If the object exists and has not already been closed, then close it

Scott Marino MSMIS Summer Session JavaScript and Browser Windows Can create a Navigation or Control Panel window –Create a new window and load it with a page of hyperlinks –Each hyperlink in the control panel performs an update of the window that opened it –function updateParent(newURL) { opener.document.location = newURL } –When called with a url in the control panel, this function sets the address of the calling window to the linked page

Scott Marino MSMIS Summer Session JavaScript and Browser Windows Positioning the new window –You can specify the position of the new widow with the “top” and “left” attributes –leftPos = 0 if (screen) { leftPos = screen.width-N } –N represents the width of the new window –Use screen.height for vertical height positioning –window.open(..."width=330,height=250,left="+leftPos +",top=0")

Scott Marino MSMIS Summer Session JavaScript and Form Validation Allows client-side validation of form data –Saves resources on the server-side –Still need validations in the CGI in the event the browser does not support JavaScript Typically the validation is performed with the onSubmit event – –The validForm function will return true or false and depending upon the result, the form will or will not be sent to the server

Scott Marino MSMIS Summer Session JavaScript Select and Go Create a form / selection list Create a function that changes the page location Use the onChange event for the form selection object to jump to the new page Should have a cgi function available to perform the same task and use the tag to generate a submit button

Scott Marino MSMIS Summer Session JavaScript Form Field Validation Multiple form elements can be validated in the same function The simplest style is to make the user correct each error as it is encountered More complex programming is required to display all errors simultaneously

Scott Marino MSMIS Summer Session JavaScript Form Field Validation Should be validated in the order that they appear on the screen –This make the most logical sense to the user Use the form.field.focus() to position the cursor in the field in error Use the form.field.select() to highlight the contents of the field in error

Scott Marino MSMIS Summer Session JavaScript Validating Numbers A text field has a datatype of string Must compare character by character looking for non-numeric characters –less than zero ( < 0 ) –greater than 9 ( >9 ) A common function is usually created to validate numeric Used for U.S. zip codes, phone numbers, dollar amounts, quantities, etc.

Scott Marino MSMIS Summer Session JavaScript Validation Can validate an address to eliminate most problems –No method is 100% Look for invalid characters Locate sign and make sure there is only one at sign Look for a period (dot) following sign

Scott Marino MSMIS Summer Session JavaScript and Regular Expressions Can use regular expressions in JavaScript re = The above expression validates an address Regular expressions are very powerful, but can be difficult to read Comment them well

Scott Marino MSMIS Summer Session JavaScript and Regular Expressions Can use regular expressions for many things –Validation of strings addresses, phone numbers, zip codes –Splitting text values apart First and last name –Formatting strings with character substitution Formatting a phone number with -’s or ()’s –Sorting strings Sorting a list of strings in a text box