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

Radios / Checkboxes not included in modified / changed condition method. #36

Open
Byte-Lab opened this issue Nov 26, 2014 · 0 comments
Open

Comments

@Byte-Lab
Copy link

It looks like radio and checkbox inputs are not included in a changed / modified trigger or condition callback. This is my current setup:

$("form").autosave({
            callbacks: {
                // Every 10 seconds, perform an autosave
                trigger: {
                    method: "interval",
                    options: {
                        interval: 10000
                    }
                },
                condition: "modified",
                save: function(options, formData) {
                    // Add AJAX spinner
                    $ajaxSavingBlock.show();
                    $.ajax({
                        url: "{{ ajax_url|raw }}",
                        data: formData,
                        dataType: "json",
                        type: 'POST',
                        success: function(data, testStatus, jqXHR) {
                            // Get rid of spinning autosave AJAX visual:
                            $(this).next("save");
                            $ajaxSavingBlock.hide();
                        },
                        error: function(jgXHR, textStatus, errorThrown) {
                            $ajaxSavingBlock.hide();
                        }
                    });

                    // Notify jQuery autosave that the AJAX call is finished
                    return false;
                }
            }
});

Changing a radio button or checkbox value does not cause the save function to get fired. Changing an input text field does. Any ideas as to how to fix this?

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