You could modify your unhighlight-function to check if an element of
the group is marked as invalid. Something like this:

unhighlight: function(element, errorClass) {
  if (element[0].name == "306" && $("#301").is(".error"))
    return;
  if (element[0].name == "301" && $("#306").is(".error"))
    return;
  element.removeClass( errorClass );
}

Jörn

On Thu, Mar 5, 2009 at 6:23 PM, Jean-Charles S <jas...@gmail.com> wrote:
>
> I have a group of fields (field "301" and "306") that are two inline
> select boxes to represent the month and year.  I've grouped them with
> the proper validate hash object ("groups") and set the errorPlacement
> to be after field "306."  All works fine as far as validation goes,
> however I've also assigned a highlight function on the field's parent
> element.  On all single fields, this works perfectly.  On the grouped
> elements, however, if the first field is marked as invalid and the
> second is marked as valid, highlight is called first for the first
> field, highlighting the parent element, but then unhighlight is called
> due to the second field and the parent element no longer has the
> correct highlighting.
>
> Is there anyway I can prevent this negating action from happening?  In
> other words, prevent unhighlight from occuring as a result of the 2nd
> field in the group technically being valid (yet the group is still
> invalid)?
>

Reply via email to