Javascript Question

0 comments

Hello,

I have multiple files that need to be connected to an html document for me to open online, not local. My files provided need to work together with the html document you create so that it can

  • name – the name of the exercise
  • reps – the number of times the exercise was performed
  • weight – the weight of the weights used
  • date – the date the exercise was performed (in the format of Month-Day-Year, e.g., 05-25-2018)
  • unit – indicating if the measurement is in lbs or kg

You need to create a single page application with the following functionality:

Visiting the page will show a table displaying all completed exercises. The header should list all the columns (id should not be displayed in the header or in the table itself. Use hidden inputs to keep track of the id).

At the top of the page there should be a form that let you enter in all the data needed to make a new entry in the table with a button to submit it. Hitting that button should add the row to the table if it was successfully added to the database. If it was not successfully added (probably because name was left blank and it is required) it should not add it to the table.

Each row should have two buttons. One to delete the row and one to edit the row. Hitting the delete button should immediately remove the row from the table and from the database.

Hitting the edit button should make it possible to edit the data. For this function, it is OK to go to another page that will allow you to edit that specific exercise, save it and then take you back to the main page. The form to edit the exercise should be pre-populated with the existing data from that row (in other words if I go to the edit page, and then hit save, nothing should change because all the old values were in the edit form).

All interactions, other than updating an exercise, should happen via Ajax. This means that at no time should the page refresh. Instead, Ajax calls should be used to GET or POST to the server and it should use the data the server provides to update the page. (Think back to the AJAX interactions assignment, where you updated your page’s DOM to show the response you received from OpenWeatherMap, for example)

About the Author

Follow me


{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}