views:

35

answers:

1

Hi,

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  A: 

I used

onkeyup : function(element){
        if ($(element).valid()==0) {
            $(element).prev().removeClass();
            $(element).prev().addClass("status_form_warning");    
        }
Jose Febus