Completed Project 6-3 Do the following: 1. Use your code editor to open the project06- 03_txt.html...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Completed Project 6-3 Do the following: 1. Use your code editor to open the project06- 03_txt.html and project06-03_txt.js files from the js06 project03 folder. Enter your name and the date in the comment section of each file and save them as project06- 03.html and project06-03.js, respectively. 2. Go to the project06-03.html file in your code editor and link the page to the project06- 03.js file, deferring loading of the script. Study the contents of the file and note field names associated with each input element within the form Save your changes to the file. 3. Go to the project06-03.js file in your code editor. Below the comment section declare the useShip variable to reference the element with the id "useShip". Add an event listener to useShip to run the copyShippingToBilling() function when clicked. 4. Create the copyShippingToBilling() function that copies values from the shipping fields to corresponding billing fields. Within the function, insert an if statement that tests whether useShip is checked and if it is, do the following: 1. Set the value of the firstnameBill field to the value of the firstnameShip field. 2. Repeat the previous step to set the value of the lastnameBill, address1 Bill, address2Bill,‹ to the values of their corresponding fields in the shipping part of the form. 3. Set the selectedIndex property of the stateBill field to the value of the selectedIndex property of the stateShip field. 5. Below the copyShippingToBilling() function do the following: 1. Declare the formElements variable and using the querySelectorAll() method store within it a node list corresponding to elements selected with "input[type='text']". 2. Declare the fieldCount variable with a value equal to the length of the formElements node list. 3. Declare the errorBox referencing the element with the id "errorBox". 6. Create a for loop that iterates through each element in the formElements node list and for each element apply an event listener that calls the showValidationError() function in response to the invalid event. 7. Create the showValidationError(evt) function and add the following commands to it: 1. For the event object, evt, apply the preventDefault() method to prevent the browser from applying the native browser tools to respond to invalid data. 2. Set the textContent property of errorBox to the text string "Complete all highlighted fields". 7. Create the showValidation Error(evt) function and add the following commands to it: 1. For the event object, evt, apply the preventDefault() method to prevent the browser from applying the native browser tools to respond to invalid data. 2. Set the textContent property of errorBox to the text string "Complete all highlighted fields". 8. Save your changes to the file and then open js06-03.html in your browser. 9. Verify that you can copy shipping address information to the billing fields by clicking the Same as Shipping Address box. 10. Verify that you cannot submit the form until all data fields are completed (aside from the second address fields) and that validation errors appear in the error box below the form. Completed Project 6-3 Do the following: 1. Use your code editor to open the project06- 03_txt.html and project06-03_txt.js files from the js06 project03 folder. Enter your name and the date in the comment section of each file and save them as project06- 03.html and project06-03.js, respectively. 2. Go to the project06-03.html file in your code editor and link the page to the project06- 03.js file, deferring loading of the script. Study the contents of the file and note field names associated with each input element within the form Save your changes to the file. 3. Go to the project06-03.js file in your code editor. Below the comment section declare the useShip variable to reference the element with the id "useShip". Add an event listener to useShip to run the copyShippingToBilling() function when clicked. 4. Create the copyShippingToBilling() function that copies values from the shipping fields to corresponding billing fields. Within the function, insert an if statement that tests whether useShip is checked and if it is, do the following: 1. Set the value of the firstnameBill field to the value of the firstnameShip field. 2. Repeat the previous step to set the value of the lastnameBill, address1 Bill, address2Bill,‹ to the values of their corresponding fields in the shipping part of the form. 3. Set the selectedIndex property of the stateBill field to the value of the selectedIndex property of the stateShip field. 5. Below the copyShippingToBilling() function do the following: 1. Declare the formElements variable and using the querySelectorAll() method store within it a node list corresponding to elements selected with "input[type='text']". 2. Declare the fieldCount variable with a value equal to the length of the formElements node list. 3. Declare the errorBox referencing the element with the id "errorBox". 6. Create a for loop that iterates through each element in the formElements node list and for each element apply an event listener that calls the showValidationError() function in response to the invalid event. 7. Create the showValidationError(evt) function and add the following commands to it: 1. For the event object, evt, apply the preventDefault() method to prevent the browser from applying the native browser tools to respond to invalid data. 2. Set the textContent property of errorBox to the text string "Complete all highlighted fields". 7. Create the showValidation Error(evt) function and add the following commands to it: 1. For the event object, evt, apply the preventDefault() method to prevent the browser from applying the native browser tools to respond to invalid data. 2. Set the textContent property of errorBox to the text string "Complete all highlighted fields". 8. Save your changes to the file and then open js06-03.html in your browser. 9. Verify that you can copy shipping address information to the billing fields by clicking the Same as Shipping Address box. 10. Verify that you cannot submit the form until all data fields are completed (aside from the second address fields) and that validation errors appear in the error box below the form.
Expert Answer:
Answer rating: 100% (QA)
Based on the given instructions you are asked to perform a series of tasks to create a form that allows users to copy shipping address information int... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
Accounting for Contingencies and Provisions In accounting, contingencies and provisions play a crucial role in preparing financial statements and ensuring accurate representation of a company's...
-
What is the wavelength of a wave that has a frequency of 1 Hz and travels at 300,000 km/s?
-
A 5-m-long, 4-m-high tank contains 2.5-m-deep water when not in motion and is open to the atmosphere through a vent in the middle. The tank is now accelerated to the right on a level surface at 2 m/s...
-
For a machine to be of the self-locking type, its efficiency should be (a) \(W=m P-c\) (b) \(W=m P+c\) (c) \(P=m W-c\) (d) \(P=m W+c\)
-
Members of the board of directors of Control One have received the following operating income data for the year ended March 31, 2012: Members of the board are surprised that the industrial systems...
-
Harris Fabrics computes its plantwide predetermined overhead rate annually on the basis of direct labor-hours. At the beginning of the year, it estimated that 29,000 direct labor-hours would be...
-
SAE specifications call for the low-side R-134a servicehose to be A) Solid blue with a black stripe B) Solid blue with no stripe C) Solid blue with a yellow stripe D) Solid black with a blue stripe...
-
Write a program showing interest earned on bank accounts, and how much is in the account after several periods (where the interest is paid into the accounts.) Show a schedule to the user of the...
-
discusses the "rule of fives" in communication. What is the "rule of fives" and why is it so important when communicating with individuals of different languages and cultures? Additionally, how would...
-
A manager of a store that sells and installs spas wants to prepare a forecast for January, February, and March of next year. Her forecasts are a combination of trend and seasonality. She uses the...
-
Three clowns move a 295 kg crate 12.0 m to the right across a smooth floor. Take the positive horizontal and vertical directions to be right and up, respectively. Moe pushes to the right with a force...
-
The poems "In a Station of the Metro" and "The Love Song of J. Alfred Prufrock. How are these poems similar to "The Love Song of J. Alfred Prufrock"? How are they different? Do you think they are...
-
Li Corporation reported pretax book income of $ 7 2 0 , 0 0 0 . Tax depreciation exceeded book depreciation by $ 4 2 4 , 0 0 0 . Li's beginning book ( tax ) basis in its fixed assets was $ 2 , 0 2 0...
-
Consider an economy that operates with a FIXED exchange rate ( E 0 ). The economy is initially in equilibrium at point 1 in the diagram below where equilibrium output/national income is Y 1 . The...
-
Anne is employed by Bradley Contracting Company. Bradley has a $1.3 million contract to build a small group of outbuildings in a national park. Anne alleges that Bradley Contracting has discriminated...
-
During 2012, Tom sold Sears stock for $10,000. The stock was purchased 4 years ago for $13,000. Tom also sold Ford Motor Company bonds for $35,000. The bonds were purchased 2 months ago for $30,000....
-
Harold Conners (Social Security number 785-23-9873) lives at 13234 DeMilo Drive, Houston, TX 77052, and is self-employed for 2012. He estimates his required annual estimated tax payment for 2012 to...
-
Please answer the following questions regarding the taxability of Social Security: a. A 68-year-old taxpayer has $20,000 in Social Security income and $100,000 in tax-free municipal bond income. Does...
-
If youd like to have $5,000,000 at retirement in 45 years and you expect to earn 10 percent annually, which is around the average return over the past 50 years, what lump sum would you have to invest...
-
Obaidullah Hamzah, who recently sold his Ford Mustang, placed $15,000 in a savings account paying annual compound interest of 7 percent. a. Calculate the amount of money that will be accrued if he...
-
How many years will the following take? a. \($550\) to grow to \($1,049.50\) if invested at 6 percent compounded annually b. \($37\) to grow to \($63.87\) if invested at 9 percent compounded annually...
Basic Biostatistics Statistics For Public Health Practice 2nd Edition - ISBN: 1284036014 - Free Book
Study smarter with the SolutionInn App