Web Hosting

Monday, August 13, 2007

Really Easy Field Validation

Form validation is a crucial thing in web applications and making them sometimes requires hard work. Here’s a form validation script that is very easy to use. It has a number of tests built-in but is extensible to include your custom validation checks. Here’s the list of tests available to add to your field elements:

  • not blank – required
  • a valid number
  • digits only
  • letters only
  • only letters and numbers
  • a valid date value
  • a valid email address
  • a valid URL
  • a date formatted as; dd/mm/yyyy
  • a valid dollar value
  • first option e.g. ‘Select one…’ is not selected option
  • At least one textbox/radio element must be selected in a group

Here is a demo of the field validation.

Article written by Ahmad Hania

Ahmad Hania is a professional designer and developer with a B.Sc. in Computer Engineering. He is interested in freelancing and blogging. He is a cofounder of Wateen Technologies an application development and hosting company. He loves video games and sports. Read more articles by Ahmad Hania at his blog Follow Ahmad Hania at Twitter and Facebook.

Follow Me

Behance Delicious DeviantART Google LinkedIn Pinterest RSS

Subscribe by Email

Enter your email address:

Sponsors

Blog Archive

  • 2019
  • 2014
  • 2013
  • 2012
  • 2011
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006

Twitter Updates

Friends

 

Warning: call_user_func_array() expects parameter 1 to be a valid callback, class 'collapsArch' does not have a method 'enqueue_scripts' in /home/customer/www/ahmadhania.com/public_html/wp-includes/class-wp-hook.php on line 308