jQuery .submit() Method

Beginner
⚠️ Deprecated since 3.3
⏱️ 10 min read
📚 Updated: Jul 2026
🎯 5 Examples
🚀 5 Try-it labs
Form events

What You’ll Learn

The .submit() method is jQuery’s legacy shorthand for binding and triggering the submit event on forms. This tutorial covers .submit(handler) since 1.0, .submit(eventData, handler) since 1.4.3, no-argument .submit() as a trigger, migration to .on("submit") and .trigger("submit"), and why the binding form is deprecated since jQuery 3.3. See the jQuery submit event tutorial for the modern API.

01

.submit(fn)

Bind handler

02

eventData

Since 1.4.3

03

.submit()

Trigger event

04

.on()

Modern bind

05

.trigger()

Modern fire

06

Deprecated

Since 3.3

Introduction

Before jQuery 1.7 unified events with .on() and .off(), every common event had a matching shorthand — .submit(), .change(), .blur(), and more. The .submit() method let you validate or intercept form sends in one short call: $("#login").submit(function(e){ e.preventDefault(); ... }). It remains in jQuery 3.x for backward compatibility but is marked deprecated.

Understanding .submit() matters when reading older login-form, contact-form, and admin-panel tutorials in legacy codebases. The method does two distinct jobs: with a function argument it binds; with no arguments it triggers. Modern jQuery splits those roles explicitly — .on("submit", handler) for binding and .trigger("submit") for firing.

⚠️
Forms only

The jQuery .submit() method applies to <form> elements — not individual inputs or buttons. Bind on the form to catch every submit path including Enter key. Do not name an input submit — it conflicts with the form’s native submit property.

Understanding the .submit() Method

The official jQuery API describes .submit() as a way to bind an event handler to the submit event, or trigger that event on an element. When you pass a handler, jQuery registers it on each matched <form> and calls it when the user attempts to submit — the same submit event that .on("submit") handles today.

When you call .submit() with no arguments, jQuery synthetically fires the submit event on each matched form. Bound handlers run and the browser performs the default submit action — navigating to action or posting data — unless a handler calls preventDefault(). This trigger behavior is equivalent to .trigger("submit").

⚠️
Deprecated since jQuery 3.3

Do not use .submit(handler) or .submit(eventData, handler) in new code. Replace them with .on("submit", handler) or .on("submit", eventData, handler). Replace no-argument .submit() with .trigger("submit"). For preventDefault, AJAX, and the full modern submit event guide, read the jQuery submit event tutorial.

📝 Syntax

The .submit() method has three signatures from the official jQuery API. The binding forms are deprecated; the trigger form remains valid but .trigger("submit") is preferred:

1. Bind a handler — .submit( handler ) (since 1.0, deprecated 3.3)

jQuery
.submit( handler )
  • handler — function executed each time submit fires: function( event ) { ... }.
  • Returns the jQuery object for chaining.
  • Modern replacement: .on( "submit", handler ).

2. Bind with eventData — .submit( [eventData], handler ) (since 1.4.3, deprecated 3.3)

jQuery
.submit( [eventData], handler )
  • eventData — optional object available in the handler as event.data.
  • Modern replacement: .on( "submit", eventData, handler ).

3. Trigger the event — .submit() (since 1.0)

jQuery
.submit()
  • No arguments — triggers submit on every matched element.
  • Runs bound submit handlers.
  • Preferred replacement: .trigger( "submit" ).

Official jQuery API migration note

jQuery
// Deprecated binding
$( "#target" ).submit( function( event ) {
  alert( "Handler for `submit` called." );
  event.preventDefault();
} );

// Modern binding
$( "#target" ).on( "submit", function() {
  alert( "Handler for `submit` called." );
} );

// Deprecated trigger
$( "#target" ).submit();

// Modern trigger
$( "#target" ).trigger( "submit" );

Return value

  • All .submit() signatures return the original jQuery object for chaining.
  • Handler return values are ignored unless you use return false (equivalent to preventDefault() + stopPropagation()).

⚡ Quick Reference

GoalLegacy (.submit)Modern replacement
Bind submit handler$("#target").submit(fn)$("#target").on("submit", fn)
Pass data to handler$("#login").submit({ formId: "login" }, fn)$("#login").on("submit", { formId: "login" }, fn)
Trigger submit programmatically$("#target").submit()$("#target").trigger("submit")
Trigger all matched inputs$("input").submit()$("input").trigger("submit")
Remove submit handlers$("#target").off("submit")$("#target").off("submit")
Delegated submit on forms$("#app").on("submit", "form", fn) — not available via .submit()
Prevent navigationevent.preventDefault() or return false

📋 .submit() vs .on("submit") vs .trigger("submit") vs .off("submit")

Four related APIs — know which one binds, which one fires, and which one removes handlers.

.submit()
deprecated

Legacy bind (.submit(fn)) or trigger (.submit()) — use modern APIs for new code

.on("submit")
bind

Modern binding since 1.7 — supports eventData and delegation on dynamic forms

.trigger("submit")
fire

Programmatically run handlers — clearer than no-arg .submit()

.off("submit")
remove

Unbind handlers — pair with .on("submit") when cleaning up or in SPAs

Examples Gallery

Five examples cover binding, eventData, triggering, migration from .submit() to .on("submit"), and method chaining. Use the Try-it links to run each snippet in the browser. Remember: binding with .submit(handler) is deprecated — these demos show legacy syntax you will encounter in older code.

📚 Binding & Triggering

Legacy .submit() signatures for binding handlers and firing events programmatically.

Example 1 — Bind Handler with .submit(handler)

The canonical legacy pattern — alert and block navigation when the user submits the form.

jQuery
$( "#target" ).submit( function( event ) {
  alert( "Handler for \`submit\` called." );
  event.preventDefault();
} );
Try It Yourself

How It Works

.submit(fn) registers the function on the form. jQuery internally routes this to .on("submit", fn). The handler runs each time the user attempts to submit — button click, Enter key, or programmatic trigger.

Example 2 — Pass eventData with .submit(eventData, handler)

Since jQuery 1.4.3, pass form metadata before the handler — it arrives as event.data.

jQuery
$( "#login" ).submit( { formId: "login" }, function( event ) {
  event.preventDefault();
  $( "#out" ).text(
    "Form: " + event.data.formId + " | user: " + $( "#user" ).val()
  );
} );
Try It Yourself

How It Works

jQuery stores the { formId: "login" } object and injects it into event.data when the form is submitted. Modern equivalent: .on("submit", { formId: "login" }, fn).

Example 3 — Trigger Submit with No-Argument .submit()

Calling .submit() without a handler fires the submit event programmatically — run handlers and perform default submit unless prevented.

jQuery
var count = 0;

$( "#target" ).submit( function( event ) {
  count++;
  $( "#out" ).text( "Target submit handler fired (count: " + count + ")" );
  event.preventDefault();
} );

$( "#fire" ).click( function() {
  $( "#target" ).submit();
} );
Try It Yourself

How It Works

The first .submit(function(){ ... }) binds a handler on #target. The button calls $("#target").submit() with no arguments — that synthetically fires submit. Replace with $("#target").trigger("submit") for clarity.

📈 Migration & Chaining

Compare legacy and modern APIs, and chain after .submit(handler).

Example 4 — Migration: .submit(fn) vs .on("submit", fn)

Both bind the same submit event — .on() is the recommended API for new code.

jQuery
$( "#legacy" ).submit( function() {
  $( "#out" ).text( "Legacy: .submit(function(){ ... }) — deprecated since jQuery 3.3." );
} );

$( "#modern" ).on( "submit", function() {
  $( "#out" ).text( "Modern: .on('submit', function(){ ... }) — use this for new code." );
} );
Try It Yourself

How It Works

Under the hood, .submit(fn) calls .on("submit", fn). Migration is a straight rename with no behavior change for simple bindings. The advantage of .on() is delegation — $("#app").on("submit", "form", fn) — which .submit() cannot do.

Example 5 — Chaining After .submit(handler)

.submit(handler) returns the jQuery object — chain validation and AJAX handlers on the same form.

jQuery
$( "#contact" )
  .submit( function( event ) {
    event.preventDefault();
    $( "#notice" ).text( "First handler: blocked default submit." ).show();
  } )
  .submit( function( event ) {
    $( "#result" ).text( "Second handler: would AJAX serialize here." );
  } );
Try It Yourself

How It Works

Multiple .submit(fn) calls on the same form stack handlers — all run when the user submits. Because each call returns the jQuery object, you can chain them fluently. The same chaining pattern works with .on("submit", fn).

🚀 Common Use Cases

  • Reading legacy code — recognize $("#login").submit(fn) as equivalent to .on("submit", fn) in older form scripts.
  • Form validation — legacy tutorials bind .submit() to validate before the browser sends data.
  • Programmatic submit$("#myForm").submit() from a custom button — replace with .trigger("submit").
  • Shared eventData$("#login").submit({ formId: "login" }, fn) passes form metadata without closures.
  • AJAX contact forms — chained .submit(fn) calls preventDefault then serialize and post.
  • Maintaining WordPress themes — many admin and front-end scripts still use .submit() — know how to migrate safely.

🧠 How .submit() Routes Through jQuery

1

You call .submit()

With a function argument, jQuery treats it as a bind request. With no arguments, it treats it as a trigger request.

dispatch
2

Bind path

.submit(handler) delegates internally to .on("submit", handler) — the handler is stored in jQuery’s event system.

.on("submit")
3

Trigger path

No-arg .submit() delegates to .trigger("submit") — bound handlers run when submit enters.

.trigger("submit")
4

jQuery object returned

Both paths return the original collection for chaining — .submit(fn).addClass("watched") works the same as .on("submit", fn).addClass("watched").

📝 Notes

  • Deprecated since jQuery 3.3 — do not use .submit(handler) or .submit(eventData, handler) in new code. Use .on("submit") instead.
  • Bind with .submit(handler) since jQuery 1.0; eventData form since 1.4.3.
  • No-argument .submit() triggers the event since jQuery 1.0 — prefer .trigger("submit").
  • .submit() does not support event delegation — use .on("submit", "form", fn) for dynamic multi-form pages.
  • Applies to <form> elements only — not individual inputs or buttons.
  • Remove handlers with .off("submit") — not by calling .submit(undefined).
  • For the full modern submit event guide — preventDefault, AJAX, and delegation — see the jQuery submit event tutorial.

Browser Support

The underlying submit event fires on <form> elements in browsers jQuery targets. The .submit() method itself is a jQuery API — it works in jQuery 1.x, 2.x, and 3.x. Binding via .submit(handler) is deprecated since 3.3 but still functional; triggering via no-arg .submit() also remains supported.

jQuery 1.0+

jQuery .submit() method

Supported across all jQuery versions you are likely to maintain. Deprecated binding since 3.3 — use .on('submit') for new projects. Native equivalent for binding: form.addEventListener('submit', fn). Native equivalent for trigger: .trigger('submit') or dispatchEvent. Always preventDefault for AJAX submits.

100% With jQuery loaded
Google Chrome All versions · Desktop & Mobile
Full support
Mozilla Firefox All versions · Desktop & Mobile
Full support
Apple Safari All versions · macOS & iOS
Full support
Microsoft Edge All versions · Chromium & Legacy
Full support
Internet Explorer IE 6+ · Legacy environments
Full support
Opera All modern versions
Full support
.submit() Legacy API

Bottom line: Safe in legacy jQuery projects. Migrate bindings to .on('submit') and triggers to .trigger('submit') when updating form validation and AJAX submit code.

Conclusion

The jQuery .submit() method is the legacy shorthand for binding and triggering submit handlers. Use .submit(handler) or .submit(eventData, handler) to bind — both deprecated since jQuery 3.3. Use no-argument .submit() to trigger — equivalent to .trigger("submit").

For new code, prefer .on("submit", fn) for binding and .trigger("submit") for programmatic firing. When you encounter .submit() in older login and contact form scripts, recognize it, understand it, and migrate when practical. For preventDefault, AJAX, and the complete modern submit event workflow, continue with the jQuery submit event tutorial.

💡 Best Practices

✅ Do

  • Use .on("submit", handler) for all new submit bindings
  • Use .trigger("submit") instead of no-arg .submit()
  • Migrate .submit(fn) to .on("submit", fn) when refactoring legacy files
  • Use .off("submit") to remove handlers cleanly
  • Read the modern submit event tutorial for preventDefault and AJAX patterns

❌ Don’t

  • Write new form handlers with deprecated .submit(handler)
  • Name an input submit — conflicts with form.submit property
  • Assume .submit() supports delegation — it does not
  • Confuse .submit(fn) (bind) with .submit() (trigger)
  • Use .unbind("submit") — it is also deprecated; use .off("submit")
  • Copy deprecated patterns from old tutorials without modernizing them

Key Takeaways

Knowledge Unlocked

Six things to remember about .submit()

Legacy bind, modern migrate.

6
Core concepts
data 02

eventData

Since 1.4.3

Handler
() 03

.submit()

Trigger

No args
.on 04

.on("submit")

Modern

Replace
05

.trigger()

Fire

Programmatic
3.3 06

Deprecated

Since 3.3

Migrate

❓ Frequently Asked Questions

The .submit() method has two roles. With a handler argument — .submit(handler) or .submit(eventData, handler) — it binds a function that runs when the user attempts to submit a matched form. With no arguments — .submit() — it triggers the submit event on each matched form, running bound handlers and performing the default submit action unless prevented. Both forms have been part of jQuery since 1.0; the binding form is deprecated since 3.3.
Yes — the binding signatures .submit(handler) and .submit(eventData, handler) are deprecated since jQuery 3.3. Use .on('submit', handler) or .on('submit', eventData, handler) instead. The no-argument .submit() trigger form still works but .trigger('submit') is clearer and preferred in modern code. Existing legacy code continues to run in jQuery 3.x; migrate when you touch those files.
.submit(handler) registers a callback — it does not fire the event immediately. .submit() with no arguments triggers the submit event programmatically on every matched form, the same as .trigger('submit'). The handler form is deprecated for binding; the no-arg form is a trigger shorthand. Always check whether parentheses contain a function before reading legacy jQuery code.
Replace .submit(fn) with .on('submit', fn). Replace .submit(data, fn) with .on('submit', data, fn). Replace no-arg .submit() with .trigger('submit'). Replace .unbind('submit') cleanup with .off('submit'). Under the hood, .submit(handler) already delegates to .on('submit') — migration is a straight rename with no behavior change for simple bindings.
Yes. jQuery 3.x keeps .submit() for backward compatibility with jQuery 1.x and 2.x codebases. It still binds and triggers correctly. The API docs mark it deprecated to steer new projects toward .on() and .trigger(). Do not use .submit(handler) in new code — prefer the modern API covered in the jQuery submit event tutorial.
No — .submit() itself does not prevent navigation. Inside your handler, call event.preventDefault() or return false to cancel the default submit. Legacy code often uses .submit(function(e){ e.preventDefault(); ... }) for AJAX forms. The no-arg .submit() trigger will navigate unless a bound handler prevents it.
Did you know?

jQuery unified event binding in version 1.7 with .on() and .off(), replacing shorthand methods like .submit(), .change(), and .bind(). The old .submit(handler) still works but is deprecated since 3.3 — under the hood it delegates to .on("submit"). The separate no-argument .submit() remains valid as shorthand for .trigger("submit"), though .trigger("submit") is clearer in modern code.

Learn the modern submit event API

Prefer .on("submit") and .trigger("submit") — full tutorial with five try-it labs.

submit event tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

6 people found this page helpful