**Apologies for the repost; had to correct the subject line. Anyone
know why text in square brackets is removed when posting via Google
Group's web form?


Hi Jörn,

I believe I've discovered a backward compatibility break when
upgrading from 1.1.2 to 1.2.1 of the Validate plugin. After a few days
of sorting through the problems I've had, I think I've narrowed down
issue down to the fact that the current version assumes in several
places that the form you're validating is actually an HTML form
element. Now, this is a pretty reasonable assumption for most use
cases, but is actually different from the previous version.

I'm developing an application with some rather large and complex
forms. The validate plugin is a critical part of the UI in these
forms. There are several places where I use a separate validator
instance to validate a subset of a large form on a button click. There
are other cases when I use the validator on elements that are not
inside a form tag at all. (I can provide more detail about my use
cases if needed.)

Near as I can tell from reading the code, there are 3 main ways the
current version depends on the HTML form tag:
1. To access the validator instance stored in the form (via
jquery.data())
2. As a query context when finding the number of elements in parts of
a form (the dependency-related methods do this)
3. As a filter in findByName()

You may know of ones I mssed, since you're much more familiar with the
code. I'd like to modify the plugin so that it no longer relies on
form element such as it does, but I'm a bit unsure about how to make
it work without it. #2 and #3 are not too hard to fix, but #1 is a
challenge. The trick is to provide a way to access the validator
instance without using "element.form", since element.form may be
undefined or refer to the wrong object.

If you have any suggestions, or alternate strategies, I'd be quite
grateful. Also, if solved, would you consider adding the patch back to
the main distributed version? The added flexibility should be useful
beyond just my case.

Regards,
Bryce Lohr

Reply via email to