Bug Tracker

Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#6264 closed bug (duplicate)

.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:
Blocked by: Blocking:

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 (6)

comment:1 Changed 13 years ago by pbowyer

subscribing for change notification

comment:2 Changed 13 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 13 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 13 years ago by etiger13

subscribing for change notification

comment:5 Changed 13 years ago by snover

Priority: undecided
Resolution: duplicate
Status: newclosed

comment:6 Changed 13 years ago by snover

Duplicate of #1414.

Note: See TracTickets for help on using tickets.