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
Fundamentals
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.
Concept
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.
Foundation
📝 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:
All .submit() signatures return the original jQuery object for chaining.
Handler return values are ignored unless you use return false (equivalent to preventDefault() + stopPropagation()).
Cheat Sheet
⚡ Quick Reference
Goal
Legacy (.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 navigation
event.preventDefault() or return false
Compare
📋 .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
Hands-On
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.
User clicks Submit on #target form
→ alert runs, page stays (preventDefault)
Deprecated — prefer .on("submit", fn) for new code
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.
Submit #login form → "Form: login | user: jane"
Same handler, shared eventData on every submit
eventData.formId passed without a closure
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.
Click Submit on #target → count increments
Click #fire → $("#target").submit() → same handler runs
No-arg .submit() is trigger shorthand — selects all text; prefer .trigger("submit")
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." );
} );
Submit #legacy form → legacy deprecation message
Submit #modern form → modern .on("submit") message
Behavior is identical — only the API name differs
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.
User submits #contact form
First handler preventDefault + shows #notice
Second handler updates #result
Both handlers run in bind order on each submit
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).
Applications
🚀 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").
Important
📝 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.
Compatibility
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 ChromeAll versions · Desktop & Mobile
Full support
Mozilla FirefoxAll versions · Desktop & Mobile
Full support
Apple SafariAll versions · macOS & iOS
Full support
Microsoft EdgeAll versions · Chromium & Legacy
Full support
Internet ExplorerIE 6+ · Legacy environments
Full support
OperaAll 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.
Wrap Up
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.
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
Summary
Key Takeaways
Knowledge Unlocked
Six things to remember about .submit()
Legacy bind, modern migrate.
6
Core concepts
.submit01
.submit(fn)
Bind
Deprecated
data02
eventData
Since 1.4.3
Handler
()03
.submit()
Trigger
No args
.on04
.on("submit")
Modern
Replace
⚡05
.trigger()
Fire
Programmatic
3.306
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.