-
Book Overview & Buying
-
Table Of Contents
jQuery 1.3 with PHP
By :
Sometimes you will need to verify that the information entered into a form is unique to the server's database, or some other server-side test that cannot easily be done on the client side.
An example is when you are asking someone for user registration details. The point of a user account is that it is a unique identifier. To be unique, it should have one field that is not shared by any other account. These days, it is very common to use the email address as that field. In the past, a username would have been more common, but there are good reasons why an email address is better.
To set this one up, copy the form.submit.php file from the previous example to a new example directory. This file will not need to change much. The rest will be rebuilt.
Here is the form.libs.php, which contains the validation rules for the form. Note the new rule terms, which have been highlighted.
<?php
$form_rules=array(
'email'=>array(
'required'=>true,
...
Change the font size
Change margin width
Change background colour