Skip to content

"data" option not sending through arrays #597

Open
@amhassen97

Description

@amhassen97

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions