Skip to main content

Bug Tracker

Side navigation

#7356 closed bug (duplicate)

Opened October 30, 2010 01:46AM UTC

Closed October 31, 2010 04:00AM UTC

Last modified October 31, 2010 04:01AM UTC

.parents() method doesnt select ':first' parent

Reported by: bixority Owned by: bixority
Priority: undecided Milestone: 1.5
Component: unfiled Version: 1.4.3
Keywords: Cc:
Blocked by: Blocking:
Description

alert() returns 'undefined' in 1.4.3 and correct field value in 1.4.2

without using ", form" everything works fine.

$("a[name='btn_edit'].btn.edit").click(function(event) {
        event.preventDefault();

        var form = $(this).parents('form:first');

        alert($("input[name='action']", form).val());
    });
Attachments (0)
Change History (5)

Changed October 30, 2010 10:46AM UTC by jitter comment:1

Please check your posting. Some words/characters seem to be missing in this part of the post

>using ", form"

As you didn't provide a test case I tried to craft one by reverse engineering your jQuery code. test case

But I can't reproduce the described problem under jQuery 1.4.3 in any recent browser. Please add a test case on http://www.jsfiddle.net which reproduces your problem and add information in which browser this happens

Changed October 31, 2010 12:57AM UTC by snover comment:2

owner: → bixority
status: newpending

Please provide a working test case.

Changed October 31, 2010 02:37AM UTC by bixority comment:3

status: pendingnew

Replying to [comment:1 jitter]:

Please check your posting. Some words/characters seem to be missing in this part of the post >using ", form" As you didn't provide a test case I tried to craft one by reverse engineering your jQuery code. test case But I can't reproduce the described problem under jQuery 1.4.3 in any recent browser. Please add a test case on http://www.jsfiddle.net which reproduces your problem and add information in which browser this happens

My test case: http://www.jsfiddle.net/bixority/U8vcH/

If you will entirely remove listFormListDiv and all its children from HTML - it will work ok.

Changed October 31, 2010 04:00AM UTC by snover comment:4

resolution: → duplicate
status: newclosed

This doesn’t have anything to do with the .parents method.

Changed October 31, 2010 04:01AM UTC by snover comment:5

Duplicate of #7212.