Hi,
On Fri, Feb 6, 2009 at 10:04 AM, Jerome Velociter <jerome(a)xwiki.com> wrote:
Guillaume Lerouge wrote:
Tested it on the incubator, looks good (apart
from the fact that the
messages & colors you choosed are a bit rough to the eye and to the user
;-)
I used the default CSS provided by livevalidation. Of course, we can
tweak that.
This could be quite handy to use on plenty of
other forms in XWiki. How
easy
will it be to add to any of our numerous
object-creation input fields
(like
create page, create blog post, new applications,
basically any field we
could think of)?
Easy. For example to add both presence and emai validation to a
field,
you add the following in a JSX object,
var emailV = new LiveValidation( "register_email" , { validMessage:
"OK.", wait: 500} ); // register_email is the id of the field to validate.
emailV.add( Validate.Presence, { failureMessage: "Field is mandatory"
} );
emailV.add( Validate.Email, { failureMessage: "Should be a valid
email" } );
I said, if we want we can also write basic CSS-based set of rules, to
allow doing validation using :
<input class="validate-email" .... />
We just need to write a piece of JS that on loading will lookup for such
classes and do the wiring. This would be for non-developers.
Looks good. 2 additional questions:
- cross-browser compatibility?