29 Dec 2009 @ 11:36 PM 
 

validation form with prototype.js

 








validation is very important to avoid data entry errors. in this article I will give an example using prototype.js form validation.
1. The first call validation.js files, prototype.js, val.css in your html header

 

2. in the form, call the validation class

3. Here’s the list of classes available to add to your field elements:

* required (not blank)
* validate-number (a valid number)
* validate-digits (digits only)
* validate-alpha (letters only)
* validate-alphanum (only letters and numbers)
* validate-date (a valid date value)
* validate-email (a valid email address)
* validate-url (a valid URL)
* validate-date-au (a date formatted as; dd/mm/yyyy)
* validate-currency-dollar (a valid dollar value)
* validate-selection (first option e.g. ‘Select one…’ is not selected option)
* validate-one-required (At least one textbox/radio element must be selected in a group – see below*)

DOWNLOAD FILE OR  DEMO



Tags Tags: , , , ,
Categories: prototype.js
Posted By: asbin
Last Edit: 10 Jun 2010 @ 12 11 AM

EmailPermalink
 

Responses to this post » (One Total)

 

Post a Comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

\/ More Options ...
Change Theme...
  • Users » 1
  • Posts/Pages » 49
  • Comments » 50
Change Theme...
  • VoidVoid « Default
  • LifeLife
  • EarthEarth
  • WindWind
  • WaterWater
  • FireFire
  • LightLight

About



    No Child Pages.