ITSE 1411 Beginning Web
Module 4 Project Assignment
Assignment
  1. Restaurant menu page
    • You must convert your menu page to a form. (You do not need to do this to your specials page.) Your current menu table was written in JavaScript. Remember, all form elements must be placed between the open and close form tags.
    • Add text boxes to your menu page next to each item sold.
    • Add a button (which must be inside the same form tags, that when pressed calls a function (placed in the head) that will calculate the order according to the number of items sold. Here is an example that calculates for one item only:
      function calculate()
      {   var error = false; 
          if (isNaN(document.forms[0].steak.value))
          {
          alert("A numeric value is required when ordering steak");
          error = true;
          }
          else
          {
              var numberSteak = parseInt(document.forms[0].steak.value);
          }
          if (!error)
          {
            total = numberSteak * 15 * 1.0825;
            window.alert("Your order totals: " + total.toFixed(2))
          }
      }     
                         
      1. The function calculate sets a variable error to false to show no error has been found.
      2. The if statement checks to make sure that an alphabetic value has not been entered.
      3. When a non-numeric value has been entered, an alert box shows the user where an error has occurred.
      4. The variable error is set to true to show that an error has occurred.
      5. When a numeric value has been entered, the value entered in the text box is converted to an integer and assigned to the variable numberSteak.
      6. The if (!error) uses the not operator to change the value of error. When true, !error will evaluate to false. When false, !error will evaluate to true. Therefore, if no error has been found, !error will perform the calculations.
      7. The calculation multiplies the number of steak ordered, the price for one steak, and then the sales tax.
      8. The alert box shows the total of the order written to 2 decimal places.
    • You will need your calculations to include all items in the menu.
  2. Restaurant application page
    • Create an employment application page with at least the following elements:
      • Must use the onsubmit event handler and show an alert box if the page does not validate.
      • An email field that is validated for a valid email address.
      • A selection box that is validated for a selection having been made.
      • A set of radio buttons validated for a radio button having been selected.
      • A reset button.
  3. Update index page with links
    • Open your index.htm page in Komodo Edit.
    • Copy all pages from your module3 folder that you need to properly display your new restaurant site to your module4 folder.
    • Update your index.htm page to link to your project4.htm page in your module4 folder.
    • Upload your index.htm page to the public_html folder and your project4.htm in your Module4 folder. Test for validation.
    • Email that your assignment is ready for grading.
  4. Student examples (You are not to copy the style or layout of student examples. These just show you what other students have done. Try to be original.)
    1. Minghua Liu Example 1