element validation going wrong for non required input
hi
i have a form which validates each element seperatly, element by element, and only submit at the end.
i seem to have a problem with non-required though.
this is my code:
if($('#questForm').validate().element('#qInput'+q_step)) {
$('#q'+q_step).fadeOut(800, function() {
//some animation for showing the next input
$('#qInput'+(q_step+1)).focus();
q_step++;
if (q_step==8) {
$('#questForm').submit();
}
});
return false;
} else {
return false;
}
when a field which doesnt have a any validation rules is in question, it doesnt run unless i do input something [it doesnt even cosider a space as valid].
the stranger thing is that when i looked at firebug, the input DID have the "valid" class applied to it!
using last versions of jquery and validate.
what am i doing wrong?
thanks