Hello all,

In general the plugin is great and I have a working solution using a
global variable to keep track of invalids because of this problem in
the library.

Short description, in the validator method that I added, I am calling
showErrors because the message needs to be dynamic. I call showErrors
with the dynamic string and then return the same string from the
validator method.

However, right after that runs, while the screen is showing the error,
calls to validate().element do not return any errors.

Further background:
This is an internal application used for captuing some barcode
information. We have written the application to keep focus in a field
until it validates, we do this by checking the validity of a field on
the blur event. I am using autocomplete to move to next field when
they scan. What I am seeing is that when the field fails validation
and the screen is showing the error, the validity check passes which
causes the code in the blur event to allow focus to move to the next
screen.


Some of the rules are simple and have static messages like required
and minimum length and they all work correctly.

I have two different rules which wrap a call to Ajax synchronously. I
do not think I can use the "remote" method because the remote returns
before getting back the error which causes the blur handler to allow
focus to move to next field.

One of the ajax wrapping rules, which has a static error message,
works fine.

The other rule, which needs to get the error message from the server,
is the one showing this incorrect behavior.

I can get this to work by breaking this call up into individual calls
for every possible error message, but then I have multiple calls to
the server when I only really need one that returns the appropriate
error message.


=======

As an aside I noticed that if I use a function instead of a string for
the message, the function is only called once, so I cannot work around
the error above by just returning true/false from the validator and
computing the message in the message function.

Reply via email to