Bug Tracker

Modify

Ticket #5159 (closed bug: invalid)

Opened 5 years ago

Last modified 5 years ago

Unexpected attribute selector behaviour

Reported by: SpadXIII Owned by:
Priority: critical Milestone: 1.4
Component: unfiled Version: 1.3.2
Keywords: selector attribute Cc:
Blocking: Blocked by:

Description

I have 2 forms with each just 2 elements:

form1:

  • text input with the name/id="name"
  • submit input with name/id="submit"

form2:

  • text input with the name/id="name2"
  • submit input with name/id="submit2"

When I try to select the submit buttons to add an onclick-event, I get unexpected results. I'm selecting the submit buttons like:

$('form[name=form1] :submit');

$('form[name=form2] :submit');

Selecting the submit in form1 does not work, while selecting the submit in form2 does work. The only difference between the 2 forms is the inputs name/id. See attached html sample.

Attachments

selector_test.html Download (1.1 KB) - added by SpadXIII 5 years ago.

Change History

Changed 5 years ago by SpadXIII

comment:1 Changed 5 years ago by dmethvin

  • Status changed from new to closed
  • Resolution set to invalid

Don't give form elements a name or id that is the same as a form method or property. That includes names like submit, id, action, method, length, etc.

 http://yura.thinkweb2.com/domlint/

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.