Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in the following java script code follow the instructions provided Hands-on Project 5-2 Hands-on Project 5-2 Change of address form Street Address City State/Province Zip/Postal

in the following java script code follow the instructions provided

Hands-on Project 5-2

Hands-on Project 5-2

Change of address form

1. Within the body section, just before the closing tag, add a script element, and then add the following function within the script element:

function processInput() {

var propertyWidth = 300;

var propertyHeight = 100;

var winLeft = ((screen.width - propertyWidth) / 2);

var winTop = ((screen.height - propertyHeight) / 2);

var winOptions = "width=300,height=100";

winOptions += ",left=" + winLeft;

winOptions += ",top=" + winTop;

window.open("confirm.htm", "confirm", winOptions);

}

2. Below the function you added in Step , add the following function to create an event listener:

function createEventListener() { var submitButton = document.getElementById("submit");

 if (submitButton.addEventListener) { 
 submitButton.addEventListener("click", processInput, false); 

} else if (submitButton.attachEvent) {

submitButton.attachEvent("onclick", processInput);

}

}

3. Below the function you created in Step , add the following code to create the event listener when the page finishes loading:

if (window.addEventListener) {

window.addEventListener("load", createEventListener, false); 

}

else if (window.attachEvent) { window.attachEvent("onload", createEventListener); 

}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional SQL Server 2012 Internals And Troubleshooting

Authors: Christian Bolton, Justin Langford

1st Edition

1118177657, 9781118177655

More Books

Students also viewed these Databases questions