Murach's JavaScript and DOM Scripting
How to use regular expressions, handle exceptions, and validate data

This chapter shows you how to use regular expressions and handle any exceptions that might be thrown by an application. Then, it presents a Register application that uses regular expressions and exception handling to do a thorough job of form validation...the kind of real-world example you need to be able to write bulletproof applications of your own.

Chapter 12
 
How to use regular expressions,
handle exceptions, and validate data
How to use regular expressions 386
How to create and use regular expressions 386
How to create regular expression patterns 388
How to use the global and multiline flags 392
String methods that use regular expressions 394
Regular expressions for data validation 396
How to handle exceptions 398
How to create and throw Error objects 398
How to use the try-catch statement to handle exceptions 400
The Register application 402
The user interface, XHTML, and CSS 402
The JavaScript code for the register_library.js file 406
The JavaScript code for the register.js file 414




Murach's JavaScript and DOM Scripting

Learn more about this book

View the table of contents


More about the eBook



Our 100% Guarantee

First, try our books for 90 days. Then, if you aren't completely convinced that our books are the best ones you've ever used, you can return them for a prompt refund...no questions asked.