Help with siblings()

Help with siblings()

I guess I should first ask, am I trying to use this correctly?

I am trying to rewrite a date validation library and chance the popup errors to be inline indicators.

Everything works except the rendering of the message.

[code]function checkDate(inDate)
{
var strDate = inDate.value;
if (strDate == '')
{
$(inDate).parents('.datebox').css('backgroundColor','red');
$(inDate).siblings('.error').prepend("<strong><em>The date is a required field.</em></strong>");
return false;
}
...
[/code]
The row that is the datebox class that is the parent gets the css change, but the error div does not get populated with the message.

Any ideas?

Complete test implementation at http://files.lordjester.com/testing/ [code][/code]
    • Topic Participants

    • jeff