github jquery-form/form v4.6.0
4.6.0

37 minutes ago

A bug-fix release. No breaking changes are intended. Behavior changes only where the old behavior was a bug or differed from a native form submission, so read the list below if your code relied on any of them. jQuery 1.7.2 or later is still supported. Every change is tested on jQuery 1.7.2, 3.7.1 and 4.0.0, and the test suite now runs on Chromium, Firefox and WebKit.

Fixes

  • target and iframeTarget strings are looked up only as selectors. Both were passed to $(), which builds elements from a string that looks like HTML and runs any inline handlers in it. A string is now looked up with $(document).find(). A selector finds the same elements as before. A string that starts with < matches nothing (and logs a message when $.fn.ajaxSubmit.debug is on). On jQuery 1.7.2, a selector with a tag in an attribute value, such as div[title="<b>"], now works. Elements and jQuery objects are used as given.
  • A lone surrogate is sent as U+FFFD. formSerialize, fieldSerialize, ajaxSubmit and iframe uploads threw URIError when a field name or value, or a key or string value in data or extraData, held an unpaired UTF-16 surrogate. Each one is now replaced with U+FFFD, as a native form submission and FormData do. A string data option is passed through unchanged.
  • Spaces encode as + on every jQuery version. On jQuery 3 and later, formSerialize, fieldSerialize, GET query strings and urlencoded bodies wrote a space as %20, while jQuery 1 and 2 and a native form submission write +. They now write + everywhere. Servers decode both the same way; only code that compares the strings sees a difference.
  • An iframe response that cannot be parsed rejects with parsererror, as error and complete already reported. When the response also carries an error status (a status attribute outside 2xx), error, ajaxError and the rejection receive its statusText, as $.ajax reports a server error.
  • An iframe upload no longer sends a clicked button that a disabled <fieldset> disables, as the other transports and a native submission already did.

Packaging

  • Bundlers get the module build. The browser field pointed at the minified classic build, so webpack, Vite and Browserify bundled it. It is removed: webpack and Vite use module (dist/jquery.form.mjs) and Browserify uses main (dist/jquery.form.js). New jsdelivr and unpkg fields keep a bare CDN URL serving dist/jquery.form.min.js.
  • The CommonJS factory uses the window it is given. require("jquery-form")(root, $) read the global window and document, so it threw in Node without a global DOM. It now takes them from root.
  • LICENSE-MIT is in the package, next to LICENSE. The license field is now the SPDX expression (LGPL-2.1-or-later OR MIT): the same terms, written the current way.
  • The package homepage is the docs site, https://jquery-form.github.io/form/.

Deprecations

  • Replacing $.fieldValue to change what is serialized logs a deprecation warning once per page when $.fn.ajaxSubmit.debug is on. It still works in 4.x; 5.0 drops it, so use jQuery valHooks instead.
  • The API docs now have a Deprecations section listing every warning and its replacement.

Docs

  • The README is now a short landing page: installation, usage (module import, CommonJS, script tag), file uploads, compatibility and security. The full reference is on the docs site.
  • The docs site's links to old malsup.com pages point at its own pages, and its demos load over https.
  • Bug reports use an issue form that asks for the plugin, jQuery and browser versions. Security reports go through SECURITY.md.

Full changelog: v4.5.0...v4.6.0

Don't miss a new form release

NewReleases is sending notifications on new releases.