You could also just bind focus and blur events to each element for the
same effect, without requiring a change to the plugin code.

Jörn

On Wed, Sep 16, 2009 at 11:32 PM, Philipp <philipp.ma...@googlemail.com> wrote:
>
> Hi!
>
> I added a nice little tweak which allows me to define custom functions
> called on (un) focussing a form element:
>
> jquery.validate.js got three additional lines at the end of onfocusin
> function (line 200):
>                        if (this.settings.focusFunction) {
>                                this.settings.focusFunction(element);
>                        }
> and at the end of onfocusout function:
>                        if (this.settings.blurFunction) {
>                                this.settings.blurFunction(element);
>                        }
>
> By defining a "focusFunction" / "blurFunction" within a jQuery
> ('#...').validate({})-block I was able to add a custom behaviour to
> those two events without writing additional JavaScript code. In my
> case I simply display or hide a div containing some help for the form
> element.
>
> Maybe this little code change will help somebody or even find its way
> to the official release.
>
> Kind regards and thank you for your validator!
>  Philipp
>

Reply via email to