Question: URGENT TASK Task 2: Trip registration (2-trip, 8 pts) We would like to save the data of a new trip that we organise. The task
URGENT TASK
Task 2: Trip registration (2-trip, 8 pts)
We would like to save the data of a new trip that we organise. The task is the server-side validation of an already structurally pre-created form (hence HTML level verification is not sufficient) according to the following conditions.
- a. (1 pt) The
tracknamefield is required. Thedistancefield is also required and can only be a number. - b. (2 pts) The
fromandtofields are required and they must contain a settlement name that is included in the array$placesfrom the starting file. The two fields cannot match! - c. (2 pts) The
timefield is required and it must be in the formatX:XXwhere theXs are digits. The highest allowed value before the colon (:) is 7, and the value after it must be less than 60. - d. (1 pt) In case of incorrect input, an error message should appear next to the given field, informing about the cause of the error.
- e. (1 pt) The form placed on the page should keep its state which means that the submitted values should be written back into the fields.
- f. (1 pt) The
divwith IDsuccessand its contents should only appear in the generated HTML code if the form was submitted by the user and no errors were found during validation.
TASK 2: TRIP REGISTRATION
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
