O'Reilly logo

Oracle® Web Application Programming for PL/SQL® Developers by Benjamin Rosenzweig, Solomon Morse, Melanie Caffrey, Susan Boardman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Unit 14.2. Regular Expressions in Form Validation

The JavaScript validation script discussed in Unit 14.1 tests only for an empty value in the case of text fields. This is not a very stringent form validation. A space in the text field would be enough to pass this script’s validation test. Stricter validation is usually more desirable so that as much validation is done on the front-end as possible. Other things that could be checked are:

  1. Whether a field exceeds its maximum length.

  2. Whether only numbers were entered into the Phone Number field.

  3. Whether only text was entered in the First Name and Last Name fields.

Writing the code to test for the length is possible with the JavaScript introduced so far in this book. However, to check if only numbers ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required