Validation with onBlur event using PHP AjaxWe have seen how to validate form using PHP & Ajax. We will improve the script further to have error message displayed by the side of the form component as we move out of the particular html form member. For example as we type the first name and move to the next member our validation will check and display the error message if any. This will give better user experience as the user comes to know immediately what the error is.Checking the availability of userid
Using the div tag to display the statusEach component of the form will have its own div tag to display the error message by the side of it. Each one is named related to the input box for easy identification. Here is one example.<tr><td>userid</td><td> <input type=text name=userid id='userid' onBlur=ajaxFunction('userid_div')></td><td><div id="userid_div"></div></td></tr>
| ||
▼ Click for more tutorial on Ajax & PHP | ||