Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 9. Validating Form Data

9. Validating Form Data

In the previous chapter, we read data entered by the user with Web forms that display controls such as text fields. In this chapter, we’ll see how to check that data—that is, validate it—before working with it.

For example, you may have an application that lets you create new users on the fly if people enter a username, email address, and password. As this chapter shows, you can check to make sure that the email address is valid before accepting it. You can also ask the user to enter the password twice and then verify that the two entries match before accepting the password. Similarly, you can check to make sure that the username a new user specifies doesn’t already exist in your application.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint