views:

31

answers:

2

This is the final step before pushing errors for inline validation:

$(("#fn_fn").parent('div:equ(0)')).addClass('item-error');

it hits this line and gives the following:

"Object doesn't support this Property Or Method"

+1  A: 

Looks like your inner selector is missing the $ sign ("#fn_fn").parent('div:equ(0)')

Try this:

$("#fn_fn").parent("div").addClass("item-error");

What is equ? Did you mean eq? If so, it would be redundant since parent() only returns 1 element.

http://api.jquery.com/eq/

http://api.jquery.com/parent/

hunter
It refers to the parent of the parent of fn
will
@will - You're trying to run `.parent()` on a string, you need the syntax like hunter has in the answer.
Nick Craver
@will, what you have is close but you need to wrap your inner code with a $ like so: `$("#fn_fn").parents("div:first").addClass("item-error");`
hunter
A: 

I'm not sure of your syntax. I'll take a stab that perhaps you meant:

$('#fn_fn').parent('div').addClass('item-error');

or similar:

$('#fn_fn').parents('div:eq(0)').addClass('item-error');

Did you mean to use the eq filter? equ isn't valid.

KP