I have the following HTML code where in this case, I have three rows of records where one of the table cells in these three records is a select/option list. I have individually assigned unique ids for these three select lists via the ids of “selectLOV1”, “selectLOV2” and “selectLOV3”
<table summary="Contacts" class="uReport uReportStandard">
<thead>
<tr>
<th id="CONTCT_NM">Contact Name</th>
<th id="TEL_NO">Telephone
<br/>No.</th>
<th id="STATE">State</th>
<th id="REAS">Reason</th>
<th id="DATE_CALLED">Date
<br/>Contacted</th>
<th id="MPA_COMMENT">Comments</th>
</tr>
</thead>
<tbody>
<tr>
<td headers="CONTCT_NM">Contact A</td>
<td headers="TEL_NO">123456</td>
<td headers="STATE">VIC</td>
<td headers="REAS">
<input type="hidden" name="f01" value="16919" />
<input type="hidden" name="f02" value="100319" />
<select name="f10" id="selectLOV1" class="lov_select">
<option value="0">--- Please select a reason ---</option>
<option value="1" selected="selected">Contacted / Spoken</option>
<option value="2">Contacted / Unavailable</option>
<option value="3">Other</option>
</select>
</td>
<td headers="DATE_CALLED">
<input type="text" name="f20" size="14" maxlength="2000" value="30/08/2012 09:42"
class="date_val" readonly="readonly" style="background-color:#B0C4DE;border:1px solid #999999;"
/>
</td>
<td headers="COMMENT">
<textarea name="f30" rows="2" cols="30" wrap="VIRTUAL">Contact A</textarea>
</td>
</tr>
<tr>
<td headers="CONTCT_NM">Contact B</td>
<td headers="TEL_NO">123456</td>
<td headers="STATE">VIC</td>
<td headers="REAS">
<input type="hidden" name="f01" value="16919" />
<input type="hidden" name="f02" value="100314" />
<select name="f10" id="selectLOV2" class="lov_select">
<option value="0">--- Please select a reason ---</option>
<option value="1" selected="selected">Contacted / Spoken</option>
<option value="2">Contacted / Unavailable</option>
<option value="3">Other</option>
</select>
</td>
<td headers="DATE_CALLED">
<input type="text" name="f20" size="14" maxlength="2000" value="30/08/2012 09:42"
class="date_val" readonly="readonly" style="background-color:#B0C4DE;border:1px solid #999999;"
/>
</td>
<td headers="COMMENT">
<textarea name="f30" rows="2" cols="30" wrap="VIRTUAL">Contact B</textarea>
</td>
</tr>
<tr>
<td headers="CONTCT_NM">Contact C</td>
<td headers="TEL_NO">123456</td>
<td headers="STATE">VIC</td>
<td headers="REAS">
<input type="hidden" name="f01" value="16919" />
<input type="hidden" name="f02" value="100312" />
<select name="f10" id="selectLOV3" class="lov_select">
<option value="0">--- Please select a reason ---</option>
<option value="1" selected="selected">Contacted / Spoken</option>
<option value="2">Contacted / Unavailable</option>
<option value="3">Other</option>
</select>
</td>
<td headers="DATE_CALLED">
<input type="text" name="f20" size="14" maxlength="2000" value="30/08/2012 09:42"
class="date_val" readonly="readonly" style="background-color:#B0C4DE;border:1px solid #999999;"
/>
</td>
<td headers="COMMENT">
<textarea name="f30" rows="2" cols="30" wrap="VIRTUAL">Contact C</textarea>
</td>
</tr>
</tbody>
</table>
Based on this, I am unsure via the use of jQuery how to target the select list I am currently on as I need a means of returning the option value for the specific row that I am on, when changed.
I am basically trying to return the select list option for the row that I am on using jQuery and I’m unsure how to achieve this as I need to perform some processing based on selection list value which can be 0, 1, 2 or 3 in this case.
hi you can do it simply like this
Live Demo