Bug Tracker

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#7356 closed bug (duplicate)

.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());
    });

Change History (5)

comment:1 Changed 9 years ago by 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

comment:2 Changed 9 years ago by snover

Owner: set to bixority
Status: newpending

Please provide a working test case.

comment:3 in reply to:  1 Changed 9 years ago by bixority

Status: pendingnew

Replying to 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.

comment:4 Changed 9 years ago by snover

Resolution: duplicate
Status: newclosed

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

comment:5 Changed 9 years ago by snover

Duplicate of #7212.

Note: See TracTickets for help on using tickets.