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

"data" option not sending through arrays #597

Open
amhassen97 opened this issue Oct 29, 2021 · 0 comments
Open

"data" option not sending through arrays #597

amhassen97 opened this issue Oct 29, 2021 · 0 comments

Comments

@amhassen97
Copy link

amhassen97 commented Oct 29, 2021

Description:

Hi

I am appending data to the ajax form when constructing the options object, The data I am appending is an array or object, which is linked to a key in the data object,

Expected Behavior:

The appended array or object used with the "data" property in the form options gets sent through to the backend.

Actual behavior:

This only works in some cases. If I append a string, the values go through fine, The issue seems to only occur with arrays and objects.

For example:

var formOptions = { beforeSubmit: validateRequest, // pre-submit callback success: showResponse, // post-submit callback error: showError, dataType: "json", data: {chosenPos : selectedPos, chosenNotifs : selectedNotifs}, resetForm: false, }
selectedPos and selectedNotifs are arrays or objects with global scope. This has worked before, but for some reason now does not seem to. It is not consistent.

Thanks for the great library!

Versions:

jquery-form: 4.3.0
jQuery: 3.5.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant