Check Input Size and display label according to expression

1

I have a function that checks if a field is less than 3 when giving focus (click) on input Email .

In short:

If CPF and RG is less than 3, it displays label[for="label-custom-field2"] and label[for="label-custom-field3

If Only RG is less than 3, it displays label[for="label-custom-field3"] and hides label[for="label-custom-field2 .

If Only CPF is less than 3, it displays label[for="label-custom-field2"] and hides label[for="label-custom-field3 .

But even though the RG is populated when focusing on the email field, label[for="label-custom-field3 is displayed.

View the code here .

    
asked by anonymous 08.08.2016 / 18:10

1 answer

0

How about something like this example ?

You can return false in the function and display what you want according to some parameter of type data-field of the text field.

Try to follow this article that you can facilitate.

    
09.08.2016 / 21:46