.submit() is jQuery’s legacy shorthand for binding or triggering the submit event on a <form> — when the user attempts to send the form. Binding is deprecated since 3.3; modern code uses .on("submit") / .trigger("submit").
Remember
// Legacy (still works; bind form deprecated since 3.3)
$("#target").submit(function (event) {
event.preventDefault(); // stop navigation
});
// Modern replacements
$("#target").on("submit", handler); // bind
$("#target").trigger("submit"); // fire handlers (+ default unless prevented)
// Bind on the <form>, not the button
Trigger with no-arg .submit() (legacy) or .trigger("submit") (preferred).
Call event.preventDefault() inside the handler to stop a full page post.
For dynamic forms, use delegated .on("submit", "form", fn) — not .submit().
Piece
Required?
Role
handler
For bind form
function(event) — runs before default submit
eventData
Optional (1.4.3+)
Extra data available as event.data
No-arg call
For trigger
Fires submit on each matched form
<form>
Yes
Only element type that receives submit
Pseudocode
Pseudocode
// Legacy
call form.submit(handler)
→ bind "submit" on form
when user submits / .submit() with no args:
fire "submit" on form
call handler(event)
if not prevented → browser posts / navigates
// Modern
call form.on("submit", handler)
call form.trigger("submit")
to migrate:
.submit(fn) → .on("submit", fn)
.submit(data, fn) → .on("submit", data, fn)
.submit() → .trigger("submit")
Reference
Cheat Sheet
Quick map from the shorthand to modern APIs.
Topic
Detail
Legacy bind
$("form").submit(handler) ⚠ deprecated 3.3
Modern bind
$("form").on("submit", handler)
Legacy trigger
$("form").submit()
Modern trigger
$("form").trigger("submit")
Cancel default
event.preventDefault() or return false
Unbind
$("form").off("submit" [, handler])
Since / status
1.0 · eventData 1.4.3 · bind deprecated 3.3
Target
<form> only
Delegation
Not via .submit() — use .on("submit", "form", fn)
Try it
Live Preview
Submit the demo form (always prevented here), or run an action with legacy .submit() (still available in jQuery 3.x).
You can also use the form Submit button below.
Result
Ready — submit the form or pick an action.
Code
jQuery Examples
Short, copy-ready snippets. Prefer .on("submit") for new projects; these demos show the legacy API you will still meet in older code.
Example 1 — Basic .submit(handler)
Legacy bind: run a handler when #target is submitted, then stop navigation.
jQuery
$("#target").submit(function (event) {
$("#out").text("Handler for submit called (.submit(fn)).");
event.preventDefault();
});
Type "correct" → Validated...
Anything else → Not valid!
How It Works
Bind. Legacy .submit(fn) listens on the form.
Check. Read the field value in the handler.
Message. Show Validated or Not valid.
Modern. Same logic with .on("submit", fn).
Edge Cases & Pitfalls
Check these before keeping or writing .submit() calls.
deprecated
Bind form is deprecated since 3.3
Prefer .on("submit", handler). The shorthand still works in jQuery 3.x for legacy code.
default
No-arg .submit() can navigate
Triggering submit runs the default form action unless a handler calls preventDefault().
names
Avoid name="submit"
Inputs named submit, length, or method can conflict with form properties.
delegation
No event delegation via shorthand
Use .on("submit", "form", fn) on a parent for dynamically added forms.
Compatibility
Browser Support
The .submit() shorthand has existed since jQuery 1.0 (eventData since 1.4.3). Binding is deprecated since 3.3 but still present in jQuery 3.x. Prefer .on("submit") / .trigger("submit") for new code.
✓ Deprecated 3.3+
jQuery .submit() shorthand
Works wherever jQuery runs for forms. Binding deprecated since 3.3 — migrate to .on('submit') / .trigger('submit'). Use preventDefault for validation and AJAX.
Legacy OKPrefer .on() / .trigger()
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()Deprecated bind
Bottom line: Safe to read in old codebases. For new work, use the submit event API with .on() and .trigger().
Analysis
Performance Notes
Approach
Cost
Best for
.submit(fn) / .on("submit", fn)
Same cost
Validation, AJAX gates
No-arg .submit() / .trigger("submit")
Cheap
Custom submit buttons
Heavy sync work before allow
Expensive
Avoid — keep checks fast
Migration from .submit() to .on("submit") does not change performance — it is a clearer, supported API.
Remember
Key Takeaways
Role: legacy shorthand for the form submit event.
Modern API:.on("submit", fn) and .trigger("submit").
Cancel:preventDefault() — shorthand does not stop navigation by itself.
Deprecated: bind form since jQuery 3.3 — migrate when you touch old files.
One line: treat .submit() as legacy — use .on("submit") / .trigger("submit") on the form.
Frequently Asked Questions
The .submit() method has two roles. With a handler — .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. Binding has been part of jQuery since 1.0 and 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) instead. The no-argument .submit() trigger still works, but .trigger("submit") is clearer. Legacy code continues to run in jQuery 3.x.
.submit(handler) registers a callback and does not fire immediately. .submit() with no arguments triggers the submit event — the same as .trigger("submit"). Check whether parentheses contain a function before reading legacy code.
Replace .submit(fn) with .on("submit", fn). Replace .submit(data, fn) with .on("submit", data, fn). Replace no-arg .submit() with .trigger("submit"). Cleanup with .off("submit"). Under the hood, .submit(handler) already delegates to .on("submit").
No. Inside your handler, call event.preventDefault() or return false to cancel the default submit. The no-arg .submit() trigger will navigate unless a bound handler prevents it.
No. Direct .submit(fn) only binds to forms that already match. For dynamic forms, use .on("submit", "form", fn) on a parent. That is one reason to prefer .on() over the shorthand.