Practice exercises CHAPTER 7 335
Figure 7-10 shows the ContactUs.html page. When you see the QueryString, it means
that the Submit button worked. Currently, the data isn’t being processed at a server.
That will come in the next chapter. For now, you want to limit the ability of the Submit
button so it doesn’t operate until data is entered in all fields.
FIGURE 7-10 he ContactUs.html pageT
Exercise 2: Add validation to the Contact Us form
In this exercise, you continue with the project from Exercise 1 and modify the ContactUs.html
file to clean up the webpage and add validation to it.
- Open the project from Exercise 1.
If you didn’t perform Exercise 1, you can use the project located in the Exercise 2 Start
folder. - Open the ContactUs.html file.
- Add the required attribute to the firstName, lastName, email, and message fields.
- Replace the type attribute on the email field with type=”email”, which will provide
added validation of the email address. - Change the message to a