Command Shift

Challenge: Add Port Form

Challenge - Add Port Form

Add Port Form

This carries on from your cruise ship GUI, so ensure that's finished first. For this assignment, we want you to give the user the ability to add ports to an itinerary (and the DOM).

You will need to:

  • Take all ports out of your itinerary object so it starts with an empty array (no ports should be rendered on the screen at this point).
  • Design a form alongside your viewport with a text input for the port's name, and a button to submit the form.
  • Intercept and prevent the form submission with JavaScript, and use the form data to create a new Port object (at which point you should update the DOM to show the new port.)

On this page