BIRT 3.7
Written by: Michael Williams
Featured Refcardz: Top Refcardz:
  1. Scrum
  2. Apache Maven 2
  3. Essential MySQL
  4. Node.js
  5. Groovy
  1. jQuery Selectors
  2. Ajax
  3. Java
  4. Spring Config.
  5. Java Concurrency

Link Details

Link 3255 thumbnail
User 194680 avatar

By bonlebon
via phphacks.com
Published: Sep 14 2006 / 05:00

Here is a simple, quick way to validate required form fields using AJAX, PHP and MySQL. What we’re going to do is display an error message to the right of the required field, and if there are errors, restrict the submit button. And if a user were to skip a required field, or leave it blank, we’ll highlight it along with removing the submit button.
  • 12
  • 0
  • 3004
  • 4

Comments

Add your comment
User 202082 avatar

ancestor replied ago:

1 votes Vote down Vote up Reply

As suggested in the article, never forget to filter $_REQUEST variables that might be passed to the database. See PHP's mysql_real_escape_string() manual for some examples http://pt.php.net/manual/en/function.mysql-real-escape-string.php

User 201021 avatar

ashiro replied ago:

0 votes Vote down Vote up Reply

I've found Dojo's form validation widget to be far superior to anything this article offers although its good as a learning tool for rolling your own validation system.

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Voters For This Link (12)



Voters Against This Link (0)