COMP 2405 Assignment 3

Assignment 3 involves some simple feature additions to your jump log application using JavaScript. The starting point for this application is the application you created for Assignment 2.

Alternatively, if you're unhappy with the application you developed in Assignment 2, you can start with this source code.

For full marks, all JavaScript code should run without generating errors or warnings. All HTML and CSS generated by your application should validate without any errors or warnings. All web pages should conform to the CRAP principles of graphic design.

  1. [5 marks] Confirm cancel: On the data entry screen, when the user selects Cancel, a confirmation box should pop up asking the user if they really intend to cancel.
  2. [10 marks]Required fields: Augment your data entry screen so that, when the user hits the submit button, some JavaScript checks that the user has entered a valid date, time, and location. If not, the form should alert the user about their error and refuse to submit itself. When this happens, the screen should set the focus on one of the missing fields.
  3. [10 marks]Validation: Augment your data entry screen so that all the numerical fields are verified every time they are changed. A numerical field is valid if it is empty, or if it represents a number (with a possible decimal). A field that is not valid should be hilighted in some way. One possibility is to change the color of the field. Note that this is for the user's information only. A form with invalid fields may still be submitted.
  4. [10 marks]Metric/imperial conversion: You should add two buttons of some kind to your data entry view and to your single jump view that allow the user to switch back and forth between metric and imperial units. When the user selects one of these buttons, all relevant text fields are updated as is any accompanying text.
  5. [10 marks]Aircraft type completion: When filling in the Aircraft field, a drop-down autocompletion menu should appear once the user has typed a few characters. This list should use the aircraft listed in this file and should be updated as more characters are typed, or the user can select an item from the list.

    More precisely, the list should appear once the number of aircraft names whose prefix matches the currently typed text is at most 10. The list should get smaller as the user types more characters and should grow (and eventually disappear) if the user deletes characters.

    Note, the user may enter an aircraft type not in the list, at which point the autocompletion list should just disappear. The user is allowed to do this.

    For this last question I will offer no help whatsoever. I know I did not cover how to do this in class, but after roughly 30 seconds of Googling I found three different ways to do this. I expect you to either come up with your own solution, or use Google to see how someone else has done it and then code your own solution.