Bug Tracker

Modify

Ticket #8330 (closed bug: duplicate)

Opened 2 years ago

Last modified 14 months ago

Can not force form to submit

Reported by: garrychilds@… Owned by:
Priority: high Milestone: 1.next
Component: event Version: 1.4.4
Keywords: Cc:
Blocking: Blocked by:

Description

When attempting to submit a form using the code below jQuery core throws an error "target[targetType] is not a function".

$("#accountSettings").submit();

accountSettings is the id of the form to submit, the form also has the same name.

The following is a snippet of the jQuery core code where the error is being reported.

try {
if ( target[ targetType ] ) {
// Make sure that we don't accidentally re-trigger the onFOO events
old = target[ "on" + targetType ];

if ( old ) {
target[ "on" + targetType ] = null;
}

jQuery.event.triggered = true;
target[ targetType ]();
}

// prevent IE from throwing an error for some elements with some event types, see #3533
} catch (triggerError) {}

if ( old ) {
target[ "on" + targetType ] = old;
} 

Change History

comment:1 Changed 2 years ago by garrychilds@…

I have just discovered that jQuery does not submit the form if the submit button is named submit, perhaps this should be looked into or documented.

Hope this helps

comment:2 Changed 2 years ago by rwaldron

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

comment:3 Changed 2 years ago by rwaldron

Duplicate of #1414.

comment:4 Changed 2 years ago by jitter

  • Priority changed from undecided to high
  • Component changed from unfiled to event

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.