O'Reilly logo

PHP jQuery Cookbook by Vijay Joshi

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

Validating numbers using jQuery

In the last recipe, we validated empty fields. In this recipe, we will extend that behavior and will check for numbers along with empty fields.

Getting ready

Create a new folder Recipe4 inside the Chapter5 directory.

How to do it...

  1. Create a new file and save it as index.html in the Recipe4 folder. We will take the same code form as used in the previous recipe and will add another section to it. So, copy the code from the previous recipe to the index.html file. Now, we will add another section to it through which a user will be able to enter some numbers. Create another section named Other Details after the Personal section. It is important to note that these fields have another CSS class named number along with required ...

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