HTML and CSS Reference
In-Depth Information
Instructions: Perform the following tasks:
1. Start Notepad++ and open the lab10-1.html file from the Chapter10\IntheLab folder of the Data
Files for Students.
2. Save the file as lab10-1solution.html.
3. Create a <script> section in the <head> section for user-defined functions.
4. Create a form for a scrolling message. Use the text ** -Danyi's Donuts make great fund-raising
items.- ** as the message.
5. Place the form for the message box text field beneath the donutOrder form table at line 100. Use
“msgBox” for the form name and use the embedded style sheet, center-items, to center the form on
the page. Name the input text field “Message” and make the width 45.
6. Using the form named donutOrder, write the JavaScript code to validate the drop-down menu and the
text field values in the form. Use nested if statements to validate that the donutType was selected and
that the count is a valid numeric value.
7. Display a message if the donut type is not selected and the number of donuts is not numeric, clear
the text field, and use the focus() method to position the insertion point back in that text field.
8. If the values are valid, compute the cost of the donuts by multiplying the selected type of donuts
times the number ordered. Assign the value to a variable totalCost.
9. Assign the totalCost to itself using the toFixed() method to set two decimal places.
10. Use the code in Tables 10-22, 10-25, and 10-26 on pages HTML 483 through HTML 487
as a guide to display the result in currency format in the donutCost text field.
11. Add a function called thankyouWindow to display the pop-up window, lab10-1thankyou.html.
12. Add a function called lastModifiedMsg to display the date the document was last modified in the
<div id="footer"> tag.
13. Be sure to add the appropriate event handlers where required.
14. Save the revised lab10-1solution.html file.
15. Test the Web page in your browser.
16. Validate the Web page using the validation Web page.
17. If any errors occur, check the code against Steps 3 through 14, make any required changes, save the
file using the same filename, and then refresh the Web page in the browser.
18. Submit the revised HTML file and Web page in the format specified by your instructor.
Search WWH ::

Custom Search