A FORM example using the REMOTE attribute and AJAX to PerformAutomatic Form Validation.

A FORM Example using the REMOTE attribute and AJAX to Perform Automatic Form Validation

The following code is an example of using AJAX with type POST to send form parameters to a PHP file once it passes form validation and the user clicks on the SUBMIT button. The form is using the REMOTE attribute on the email and username field. On those two INPUT elements, the REMOTE attribute is added to run a couple of PHP files. Those PHP files queries a SQL database and checks to see if whatever the user is entering in the field, already exist in the database. If the email address and/or username the user is entering in, already exist in the database, the jQuery validator will let the user know their entry already exists. Once all issues are rectified and the user clicks on the submit button, the submitHandler will perform run the PROCESS.PHP to take the form data and insert it into the MySQL database.

Leave a Reply

Your email address will not be published. Required fields are marked *