I'm not sure what the {$k} part is all about, but you should be able
to select that tr by using ...parents('tr:first') rather
than ...parents('tr:last')
--Karl
____________
Karl Swedberg
www.englishrules.com
www.learningjquery.com
On Jul 16, 2008, at 6:47 PM, dumkat wrote:
I am returning a form in an ajax call that is built with a table
I want to find an input
$('input[{$k}]')
then i want the immediate parent tr of that input.
I have tried
$('input[{$k}]').parents("tr:last").addClass("error-field");
and
$('input[{$k}]').parents("/../tr:last").addClass("error-field");
but both solutions get a different tr that i don't want to change.
the html looks like
<tr>
<td>E-Mail Address</td>
<td><input name="email" type="text" value="email" /></td>
</tr>
and i want to add the class to the tr.
any help would be greatly appreciated. Thanks.
--
View this message in context:
http://www.nabble.com/parent-help-tp18498309s27240p18498309.html
Sent from the jQuery General Discussion mailing list archive at
Nabble.com.