Skip to content
This repository was archived by the owner on Jul 29, 2022. It is now read-only.
This repository was archived by the owner on Jul 29, 2022. It is now read-only.

Allow repeated attempt to save changes on error #192

@feihtthief

Description

@feihtthief

Description

If the edit form gets submitted, but the server responds with a non-success code, the form should stay open and it should be possible to re-submit. Currently the res-submission is blocked because isSubmitting stays true after the ajax call completes, thereby preventing further save attempts. Cancelling would result in the users changes getting lost.

How to reproduce

https://jsfiddle.net/feihtthief/az9k2jh0/3/

Expected result

Repeated attempts to save the data should be allowed if the first one fails.

Actual result

Only the first attempt to save gets submitted to the server. The others are blocked because isSubmitting is still true

Environment

jQuery version: 3.3.1
Browser: Chrome
OS: Windows

Potential fix

Add the following to the defaults for ajaxoptions

complete: function (xhr, status) {
    isSubmitting = false;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions