Bug Tracker

Modify

Ticket #6264 (closed bug: duplicate)

Opened 3 years ago

Last modified 3 years ago

.submit() silently fails if the form has a <input name="submit">

Reported by: gnarf Owned by:
Priority: undecided Milestone: 1.4.3
Component: event Version: 1.4.2
Keywords: Cc:
Blocking: Blocked by:

Description

.submit() silently fails if the form has a <input name="submit"> or <input id="submit">

The event trigger function tries caling target[ type ] as a function without first checking to see if it is really a function.

On a form with <input type="submit" name="submit"> form.submit could be the submit button.

If it is, it might be smart to just trigger a "click" on it and hope for the best.

Change History

comment:1 Changed 3 years ago by pbowyer

subscribing for change notification

comment:2 Changed 3 years ago by gnarf

This might be a better solution for when target[type] is not a function:

document.createElement(target.nodeName)[type].apply(target)

comment:3 Changed 3 years ago by dmethvin

This occurs for any element with the name of a form element property (length, action, method, etc.)

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

comment:4 Changed 3 years ago by etiger13

subscribing for change notification

comment:5 Changed 3 years ago by snover

  • Priority set to undecided
  • Status changed from new to closed
  • Resolution set to duplicate

comment:6 Changed 3 years ago by snover

Duplicate of #1414.

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.