jquery-form / form

jQuery Form Plugin
https://jquery-form.github.io/form/
GNU Lesser General Public License v2.1
5.19k stars 2.14k forks source link

Enhancements needed to to be fully compatible with jQuery 3 #544

Open kevindb opened 6 years ago

kevindb commented 6 years ago

jQuery 3 is removing a lot of features that have been depreciated for a long time. Some of these are still in use by jQuery Form. https://jquery.com/upgrade-guide/3.0/

I have very little experience working with jQuery Deferred or Promises, so pull requests and assistance in updating jQuery Form is greatly appreciated.

Known issues

  1. 541 success and error Deferred methods

    https://jquery.com/upgrade-guide/3.0/#breaking-change-special-case-deferred-methods-removed-from-jquery-ajax

  2. 353 .selector property

    https://jquery.com/upgrade-guide/3.0/#breaking-change-deprecated-context-and-selector-properties-removed

Other related issues:

527 feature for Deferred

401 Submit only if a promise is resolved

arirangz commented 5 years ago

Hi Kevin!

Thanks for this great plugin!

Do you have any progress on updating it for jQuery 3?

I have an issue using it, the selector is not working good : $('form#myFormID').ajaxForm({ will trigger submit of any form in the page even forms with another ID.

Thanks

arirangz commented 5 years ago

Hi again,

I am not a pro on github so I create a fork and modified the code to work with jquery 3 : https://github.com/arirangz/form/blob/master/src/jquery.form.js

I replaced this.selector (which is now obsolete) by options.selector. So we need to provide the selector as an option : $('form#myID').ajaxForm({ selector: 'form#myID', target: '#myTarget', delegation: true, type: 'post', ....

I don't know if it's the best way but it works for me

Cheers

uthirapandian commented 5 years ago

Hi, any update on this? We are also upgrading our website to jQuery 3.3.1 and seeing issues with jQuery form plugin. Please let us know.

JamoCA commented 4 years ago

Another warning from JQueryMigrate jQuery.isFunction() is deprecated and jQuery.trim is deprecated; use String.prototype.trim.

$.trim(action) can be replaced with action.trim().

isFunction is used in 3 places. According to the jQuery documentation, this can be replaced with (typeof x === "function")

pacmanito commented 3 years ago

@kevindb hi, guys. The library is used in Wordpress and it is one of the last ones with deprecated jQuery code, can you please replace the left instances of $.isFunction and make and update?

yasnaderi commented 2 years ago

Hi @kevindb , The context property is removed in JQuery 3.0.

Do you have any plan to update the plugin to be compatible with JQuery 3.5?

Thanks

indigoxela commented 1 year ago

It seems like @xaabi6 sneaked in last autumn and provided a pull request, that fixes all the deprecation nagging.

@kevindb any chance, that you're having a look? The code changes seem reasonable and would be a big step forward.

yookoala commented 10 months ago

Any update to this yet?