Silver Challenge: Validating Against the Remote Server

Your validation code currently does a simple domain check. Update your validation code so that it also checks whether an email address has already been used for an order that exists on the server. Prevent the form from being submitted if that address has been used and provide an appropriate validation warning.

You may want to open a second browser window for CoffeeRun and enter different coffee orders in the two windows.

Pay attention to how often a request is sent to the server when doing this validation check. (You can see these in the DevTools network panel.) Can you find a good way to minimize the number of requests?

Get Front-End Web Development: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.