Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
kevindb opened this issue Mar 3, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@kevindb
Copy link
Contributor

commented Mar 3, 2018

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

This comment has been minimized.

Copy link

commented Jun 28, 2019

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

This comment has been minimized.

Copy link

commented Jun 29, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.