4
I’m using jQuery Masked Input Plugin with jQuery Validation Plugin. When a form field loses focus, the validation plugin shows a message, but this is not happening with the fields that are have masks, perhaps because the Blur event happens and checks that the field is not empty, in fact, the field is filled with the mask.
So I overwrote the method required from the validation plugin to check the masks too, but I have to check the mask. As I have several masks can not hard code the mask, I would have to call a method in the plugin that returns me the mask linked to the field. I did not find the plugin documentation and anyone with my problem.
Does anyone know if there is a method that returns the mask linked to the field?
Looking at the source code it seems that the value passed by parameter to the function
mask
is not stored anywhere.– utluiz
I searched a little and found a solution to my problem that would be to use the unmask method and check if the value without the mask equals empty.
– Philippe Gioseffi
Ah, ok. I posted a partial response in every case. But you better answer yourself and accept your answer as sure.
– utluiz
I haven’t implemented it yet to see if it works, even because I only passed the value, now I have to pass the whole object. I’ll look at your answer, it might be an idea.
– Philippe Gioseffi