Adding JS functionality to handle the error and success events when submitting the request and displaying informational alerts to the user.