Really Easy Field Validation - Version 1.5.4

Saturday, January 6, 2007

I've uploaded version 1.5.4 of the Really Easy Field Validation library . This version adds a 'validate-selection' validator - to check and see if the selected option on a select element is not the first one. That's the one that usually reads 'Select one...'. Also I've added a bunch of options for custom validators to make it easy to do common validation functions without having to write a function. I've also moved the documentation out of the blog and into a more stable place. The old blog post had gone over the 200 comments mark. Enjoy! [UPDATED!] Oops, left a trailing comma on an array.. 1.5.4.1 is now available, sorry folks.

7 Comments

#1
On the January 10, 2007, Michiel  wrote:

Thanks! I implemented it right away.

#2
On the January 31, 2007, raj wrote:

hello its a great script but i have one question that can i use image button for validation reset function if yes plz tell me, Thank you for your great script !!

#3
On the February 2, 2007, Andrew Tetlaw wrote:

Sure can, raj,
Just add a call to valid.reset() on the onclick event of the element.

#4
On the August 9, 2007, Zon wrote:

Hi,

Very interesting!
Just read http://www.gregphoto.net/index.php/2006/07/30/ajax-form-validation/#comment-82919
It would be great if your idea and the idea above could be combined to get the best of both worlds:
1) simple class based client-side validations and
2) robust (and possibly complex) server based validations; where all the validations are kept on the server

Cheers,
Zon

#5
On the July 22, 2008, Allan wrote:

Hi, as you know, this validation has a fucntion (validate-date-au) to validate the date format for dd/mm/yyyy, but now, I want a one for the format yyyy=mm-dd, and I have change the code to:

'-------------------------------
['validate-date-cn', 'Sorry, your date format is incorrect, it shoud be YYYY-MM-DD.', function(v) {
if(Validation.get('IsEmpty').test(v)) return true;
var regex = /^(d{4})-(d{2})-(d{2})$/;
if(!regex.test(v)) return false;
var d = new Date(v.replace(regex, '$2/$1/$3'));
return ( parseInt(RegExp.$2, 10) == (1+d.getMonth()) ) && 
(parseInt(RegExp.$1, 10) == d.getDate()) && 
(parseInt(RegExp.$3, 10) == d.getFullYear() );
}],
'-------------------------------

but it doesn't work, can you help me to correct my code? thank you very much......

#6
On the July 22, 2008, Allan wrote:

I got it, don't worry

#7
On the September 26, 2008, avenger wrote:

dont' work with prototype 1.6+, :(

Leave your comment


HTML tags will not work. Your email address will never be displayed. If you have a Gravatar we'll display it.

Random outings from a chaotic mind

The Dexagogo Rocket Australian Web Industry Association logo

Delicious

Twitter