AJAX Form Validation class="" Please enter a valid date. E-mail: " / " Invalid e-mail address. Phone number: " / " Please insert a valid US phone number (xxx-xxx-xxxx). | AJAX Form Validation class php echo _SESSION errors txtBthYear Please enter a valid date. span br Email label for txtEmail E-mail label input id txtEmail name txtEmail type text onbl ur validate this .val ue value php echo _SESSION values txtEmail span id txtEmailFailed class php echo _SESSION errors txtEmail Invalid e-mail address. span br -- Phone number -- label for txtPhone Phone number label input id txtPhone name txtPhone type text onbl ur validate this .val ue value php echo _SESSION values txtPhone span id txtPhoneFailed class php echo _SESSION errors txtPhone Please insert a valid US phone number xxx-xxx-xxxx . span br -- Read terms checkbox -- input type checkbox id chkReadTerms name chkReadTerms class left onbl ur validate this .checked php if _SESSION values chkReadTerms on echo checked checked I ve read the Terms of Use span id chkReadTermsFailed class php echo _SESSION errors chkReadTerms Please make sure you read the Terms of Use. span -- End of form -- hr span class txtSmall Note All fields are required. span br br input type submit name submitbutton value Register class left button form fieldset body html 7. Create a new file named and add the following code to it php clear any data saved in the session session_start session_destroy DOCTYPE html PUBLIC - W3C DTD XHTML EN http TR xhtml11 DTD html xmlns http 1999 xhtml head title AJAX Form Validation title meta http-equiv Content-Type content text html charset utf-8 link href rel stylesheet type text css head 130 Chapter 4 body Registration Successfull br a href title Go back lt lt Go back a body html 8. Create a file named . This file performs the client-side functionality including the AJAX requests holds an instance of XMLHttpRequest var xmlHttp createXmlHttpRequestObject holds the remote server address var serverAddress when set to true display detailed error messages var .