0

I have a form with tho fields. The first one is required.

step 1. When I submit the form, I get the error as expected. step 2. Then if I enter a text on the field, the error text is clear, which is perfect.

My only concern is that if I remove the text entered, leaving the field empty, the validation don't fire up!

Is there a way to force validation on empty fields? or at least use the callback function that is used on step 2? I want to perform some tasks when a validation fails.

The goal is to change the class of a label every time the validation fails.

1 Answer 1

1

I used

onkeyup : function(element){
        if ($(element).valid()==0) {
            $(element).prev().removeClass();
            $(element).prev().addClass("status_form_warning");    
        }
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.