Web Page Design- Content Analysis
Chapter E10.pptx
WPDD202: Webpage Design & Development
Version 2 – 18th December 2015
Kent Institute Australia Pty. Ltd.
ABN 49 003 577 302 CRICOS Code: 00161E RTO Code: 90458 TEQSA Provider Number: PRV12051
1
Resource Material
Web Design with HTML & CSS3: Comprehensive, 8th Edition
Jessica Minnick; Lisa Friedrichsen
ISBN-10: 1305578163 | ISBN-13: 9781305578166 © 2017
Cengage Learning Australia
2
2
Creating Pop-Up Windows, Adding Scrolling Messages, and Validating Forms
Chapter 10
3
Chapter Objectives
Write a JavaScript user-defined function to display a scrolling message
Write a JavaScript user-defined function to validate form data
Write a JavaScript user-defined function to calculate a total loan amount based on a sales amount and down payment
Write a JavaScript user-defined function to calculate monthly loan payments
Chapter 10: Creating Pop-Up Windows, Adding Scrolling Messages, and Validating Forms
4
4
Chapter Objectives
Define if and if...else statements, conditionals, and operands
Write a JavaScript user-defined function to format output in a text field
Describe how to open a pop-up window
Chapter 10: Creating Pop-Up Windows, Adding Scrolling Messages, and Validating Forms
5
5
Plan Ahead
Determine what you want the code to accomplish
Determine the overall Web page appearance
Determine the data validation requirements
Determine the calculations needed
Chapter 10: Creating Pop-up Windows, Adding Scrolling Messages, and Validating Forms
6
Creating a Form Text Field to Display a Scrolling Message
Chapter 10: Creating Pop-Up Windows, Adding Scrolling Messages, and Validating Forms
7
7
Creating the scrollingMsg() User-Defined Function
Chapter 10: Creating Pop-Up Windows, Adding Scrolling Messages, and Validating Forms
8
8
Incrementing a Variable
Chapter 10: Creating Pop-up Windows, Adding Scrolling Messages, and Validating Forms
9
Entering the Code to Increment the Position Locator Variable
Chapter 10: Creating Pop-Up Windows, Adding Scrolling Messages, and Validating Forms
10
10
Entering an If Statement
Chapter 10: Creating Pop-Up Windows, Adding Scrolling Messages, and Validating Forms
11
11
Entering an If Statement
Chapter 10: Creating Pop-up Windows, Adding Scrolling Messages, and Validating Forms
12
Entering an If Statement
Chapter 10: Creating Pop-up Windows, Adding Scrolling Messages, and Validating Forms
13
Entering an If Statement
Chapter 10: Creating Pop-up Windows, Adding Scrolling Messages, and Validating Forms
14
Entering an If Statement
Chapter 10: Creating Pop-Up Windows, Adding Scrolling Messages, and Validating Forms
15
15
Adding the setTimeout() Method to Create a Recursive Call
Chapter 10: Creating Pop-Up Windows, Adding Scrolling Messages, and Validating Forms
16
16
Objects and Associated Event Handlers
Chapter 10: Creating Pop-up Windows, Adding Scrolling Messages, and Validating Forms
17
Entering the onLoad Event Handler to Call the scrollingMsg() Function
Chapter 10: Creating Pop-Up Windows, Adding Scrolling Messages, and Validating Forms
18
18
Validating Forms Using Nested if…else Statements
Chapter 10: Creating Pop-up Windows, Adding Scrolling Messages, and Validating Forms
19
Validating Forms Using Nested if…else Statements
Chapter 10: Creating Pop-up Windows, Adding Scrolling Messages, and Validating Forms
20
Validating Forms Using Nested if…else Statements
Chapter 10: Creating Pop-up Windows, Adding Scrolling Messages, and Validating Forms
21
Using Built-In Functions to Validate Data
Chapter 10: Creating Pop-up Windows, Adding Scrolling Messages, and Validating Forms
22
Using Built-In Functions to Validate Data
Chapter 10: Creating Pop-up Windows, Adding Scrolling Messages, and Validating Forms
23
Adding the valSalesAmt() Function with Nested if…else Statements to Validate Form Data
Chapter 10: Creating Pop-Up Windows, Adding Scrolling Messages, and Validating Forms
24
24
Entering the onBlur Event Handler to Call the valSalesAmt() Function
Chapter 10: Creating Pop-Up Windows, Adding Scrolling Messages, and Validating Forms
25
25
Entering the CalcLoanAmt() User-Defined Function
Chapter 10: Creating Pop-Up Windows, Adding Scrolling Messages, and Validating Forms
26
26
Entering an onClick Event Handler to Call the CalcLoanAmt() Function
Chapter 10: Creating Pop-Up Windows, Adding Scrolling Messages, and Validating Forms
27
27
Entering Code to Call the monthlyPmt() Function
Chapter 10: Creating Pop-Up Windows, Adding Scrolling Messages, and Validating Forms
28
28
Creating the monthlyPmt() Function
Chapter 10: Creating Pop-Up Windows, Adding Scrolling Messages, and Validating Forms
29
29
Split Method
Chapter 10: Creating Pop-up Windows, Adding Scrolling Messages, and Validating Forms
30
Entering the dollarFormat() Function
Chapter 10: Creating Pop-Up Windows, Adding Scrolling Messages, and Validating Forms
31
31
Using a while Loop an if…else Statement
Chapter 10: Creating Pop-up Windows, Adding Scrolling Messages, and Validating Forms
32
for Loops and while Loops
Chapter 10: Creating Pop-up Windows, Adding Scrolling Messages, and Validating Forms
33
Entering an if…else Statement and While Loop to Extract the Dollar Portion of the Output and Insert Commas
Chapter 10: Creating Pop-Up Windows, Adding Scrolling Messages, and Validating Forms
34
34
Reconstructing the Formatted Output and Returning the Formatted Value
Chapter 10: Creating Pop-Up Windows, Adding Scrolling Messages, and Validating Forms
35
35
Passing the Monthly Payment Value to the dollarFormat() Function
Chapter 10: Creating Pop-Up Windows, Adding Scrolling Messages, and Validating Forms
36
36
Adding a Pop-Up Window
A pop-up window appears over the previously opened browser window
Chapter 10: Creating Pop-Up Windows, Adding Scrolling Messages, and Validating Forms
37
37
Adding a Pop-Up Window
Chapter 10: Creating Pop-up Windows, Adding Scrolling Messages, and Validating Forms
38
Entering the popUpNotice() Function to Open a Pop-up Window
Chapter 10: Creating Pop-Up Windows, Adding Scrolling Messages, and Validating Forms
39
39
Adding the Event Handler to Call the popupNotice()Function
Chapter 10: Creating Pop-Up Windows, Adding Scrolling Messages, and Validating Forms
40
40
Displaying the Date Last Modified Using the substring() Method
Chapter 10: Creating Pop-Up Windows, Adding Scrolling Messages, and Validating Forms
41
41
Chapter Summary
Write a JavaScript user-defined function to display a scrolling message
Write a JavaScript user-defined function to validate form data
Write a JavaScript user-defined function to calculate a total loan amount based on a sales amount and down payment
Write a JavaScript user-defined function to calculate monthly loan payments
Chapter 10: Creating Pop-Up Windows, Adding Scrolling Messages, and Validating Forms
42
42
Chapter Summary
Define if and if...else statements, conditionals, and operands
Write a JavaScript user-defined function to format output in a text field
Describe how to open a pop-up window
Chapter 10: Creating Pop-Up Windows, Adding Scrolling Messages, and Validating Forms
43
43
kent.edu.au Kent Institute Australia Pty. Ltd. ABN 49 003 577 302 ● CRICOS Code: 00161E ● RTO Code: 90458 ● TEQSA Provider Number: PRV12051
44
44