Hi,
Using a regular selector, I can select the grand parent of the input text box (which is actually an element) and through .next () I selected the following line.
var nextOne = $(this).parent().parent().next();
From this next ro, I want to select an input text box that is ".foo", which is the grandson of this line.
How can this be achieved?
Edit: Each line is in the following html format:
<tr>
<td ><input alt="time" type="text" class="timefield start_time"/></td>
<td ><input alt="time" type="text" class="timefield end_time"/></td>
<td ><input type="text" class="programnamefield"/></td>
</tr>
And the method that chekcs, if the end_time field is filled in, if so, change the start_time of the next line to the end_time of the previous one. And vice versa.
function autoCompleteTimes(){
$('.end_time').change(function(){
var nextOne = $(this).parent().parent().next();
});
}
source
share