Skip to main content

Bug Tracker

Side navigation

#11295 closed bug (invalid)

Opened February 07, 2012 09:02AM UTC

Closed February 22, 2012 08:06AM UTC

.children() traversing error

Reported by: tdajka@gmail.com Owned by: tdajka@gmail.com
Priority: undecided Milestone: None
Component: unfiled Version: 1.4.2
Keywords: Cc:
Blocked by: Blocking:
Description

I've the following peace of table:

<tr id="new_1" style="">

<td id="new_range_start_1" align="center">0</td>

<td>-></td>

<td>

<input type="text" id="limit_1" name="limit_1" value="" onchange="setNextRow(this);">

</td>

<td>

<input type="text" id="percent_1" name="percent_1" value="">

</td>

<td>

</td>

</tr>

When I add another row after this - tested, working fine - I want to set the new row's first cell from the previous row's 2nd cell's input with the following code:

var prev_end = parseInt($('#new_'+ranges_cnt).prev().children('td:eq(2) input').val());

it's not working. I'm getting 'undefined'. However, this code works:

var prev_end = parseInt($('#new_'+ranges_cnt).prev().children('td:eq(2)').children('input:eq(0)').val());

Attachments (0)
Change History (2)

Changed February 07, 2012 11:26AM UTC by sindresorhus comment:1

owner: → tdajka@gmail.com
status: newpending

Thanks for taking the time to contribute to the jQuery project! Please provide a complete reduced test case on jsFiddle to help us assess your ticket.

Additionally, be sure to test against the jQuery Edge version to ensure the issue still exists. To get you started, use this boilerplate: http://jsfiddle.net/FrKyN/ Open the link and click to "Fork" (in the top menu) to get started.

Changed February 22, 2012 08:06AM UTC by trac-o-bot comment:2

resolution: → invalid
status: pendingclosed

Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!