-
Book Overview & Buying
-
Table Of Contents
PHP jQuery Cookbook
By :
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.
Create a new folder Recipe4 inside the Chapter5 directory.
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 assigned to them. This way we will be able to validate for empty fields as well as for numbers.
<fieldset>
<legend><strong>Other Details</strong></legend>
<table>
<tbody>
<tr>
...
Change the font size
Change margin width
Change background colour