----- Original Message ----- 
From: "Joe Germuska" <[EMAIL PROTECTED]>
Sent: Tuesday, April 12, 2005 8:54 PM


> This page http://www.quirksmode.org/index.html?/dom/error.html
> demonstrates a more graceful way of alerting users to errors in their
> form than an "alert" window.  (In case you don't feel like clicking,
> it uses Javascript and the DOM to add a message and change the CSS
> style of the error fields.)
>
> Can anyone think of a good way to open up the validator javascript so
> that a user could plug in handling like this when desired?  Perhaps
> we could define a "handleErrors(obj)" method which would receive an
> array of error objects, and the default implementation would do the
> same thing which currently happens now; then users could simply
> redefine the function if they wanted to do something fancier.

Thats one of the things I was aiming for in the validator enhancement I was
working on.  Part of the problem though is in letting the handleErrors()
method know where to put a particular fields error message and what css
style to set - or if valid reset.

> I'm guessing that an error object could just be a tuple with the
> actual DOM element representing the input field which has an error
> and the message which is currently returned.
>
> Perhaps someone braver than I would actually want to do something
> more elaborate which made it easier for users to simply plug in more
> advanced handling by using a config option or something.  But even if
> not, simply defining a method as an extension point would be nice.
>
> Speaking of all this, Niall, whatever happened to your proposed
> overhaul of validation?  That looked really promising.

Its "in-progress" - except I haven't given it any time so far this year :-(.
I am planning to re-visit it, as it has stuff I want to implement.

Niall

> Joe
>
> -- 
> Joe Germuska
> [EMAIL PROTECTED]
> http://blog.germuska.com
> "Narrow minds are weapons made for mass destruction"  -The Ex



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to