victorjonsson / jQuery-Form-Validator

[DISCONTINUED] jQuery plugin that makes it easy to validate user input while keeping your HTML markup clean from javascript code.
971 stars 475 forks source link

Problem with validateOnKeyUp #559

Open jbustamanterendon opened 7 years ago

jbustamanterendon commented 7 years ago

Hello,

The form validator always set the event "validateOnKeyUp", check:

if (!result.isValid && attachKeyupEvent) { $elem.validateOnKeyUp(language, conf); }

You need to take into account the variable "validateOnKeyUp" that is configured when creating a validation.

Best regards.

victorjonsson commented 7 years ago

I'm not totally sure about this. I think there is a special case when you want the event to be attached even though the setup configuration says otherwise.

Could you give me a complete report explaining the unwanted behaviour of the plugin, including the form markup and the javascript setup.

jbustamanterendon commented 7 years ago

Hello,

You have all the reason, it was for a validation as we had done where a non-asynchronous "ajax" was created and generated the problem that at each moment of doing a "keyup" launched the validation.

Simply doing the "ajax" with "async: true" has worked without modifying its plugin.

I only have one question, why does the "reValidate" function exist? I ask it because in that validation that I have made I launched a call ajax, and it was called twice, I had to put inside the function a conditional "if (eventContext == 'blur') {...}"

Thanks for everything, your plugin is phenomenal !.

Best regards.