That isn't even valid - having the <div> not inside a <td> or <th>. That could lead to problems, but you might want to try:

$("#{field_id}").parent().prev('.generalclass');

Like I said it might not even work considering the markup you are showing is invalid in HTML and XHTML.

If for some reason you missed the <td></td> surrounding the div then try this:

$("#{field_id}").parents('td').prev('.generalclass');


Jamie Holly
http://www.intoxination.net http://www.hollyit.net



Jeff Greenberg wrote:
Jamie Holly wrote:

> $("#{field_id}").prev('label') will give you the label
Might have worked if the label were encased in <label> tags, but it's really ugly...like this

<tr>
<td class="generalclass">labeltest</td>
<div>field</div>
</td>
</tr>

don't know why it was done that way. I tried prev("td"), prev("td.generalclass") and prev("tr") ... nada

Reply via email to