Probably an easy task but I can not find a working solution?
I need to add a class value from a selected option to relative TR:
<table>
<tr class="odd views-row-first">
<td class="views-field views-field-website-id">1</td>
<td class="views-field views-field-changed">1349422708</td>
<td class="views-field views-field-created">1349422708</td>
<td class="views-field views-field-title">Double field</td>
<td class="views-field views-field-field-rules-conditional views-field-editablefield">
<div id="editablefields-field-rules-conditional" class="editablefield-item">
<select id="edit-field-rules-conditional-0-field-rules-conditional-und" name="field_rules_conditional[0][field_rules_conditional][und]" class="form-select">
<option value="_none">- None -</option>
<option value="green">green</option>
<option value="red">red</option>
<option value="blue" selected="selected">blue</option>
</select>
</div>
</td>
</tr>
</table>
What I want to have:
<tr class="odd views-row-first blue">
the
indexfunction will solve your problem.try following :Edit: give your table an Id as well.i have used “tableId” in the example,so replace with one you want.