Two common errors that you might run across when submitting information for an update, are that the begin time starts in the past or the end time is before the begin time. Unfortunately, the database error message that is returned does not express this clearly. Since we have already sanitized the dates and times for both of the fields, it is unlikely to be a syntax error.

Two checks are added to the error reporting to give the user a better idea of the problem.

Also, the gotoAction and return calls are added so that the form is reloaded after an error. The user can then decide if they want to fix the problem or exit.

With these last changes, the edit action is complete.

Steps to complete: