I have encountered an issue while trying to automatically submit a form on my Ruby on Rails website. Here is the code I am using:
var autosave = window.setInterval("autosaveForm()", 5000);
function autosaveForm() {
$("#myForm").trigger("submit.rails");
}
The problem is that although the form is being submitted every 5 seconds, it does not update the parameters sent by the form. For instance, if I type something in a textarea within the form, the auto-submission does not include what I typed but instead sends the default value of the textarea or whatever was there when the page first loaded.
If this explanation is unclear or you require more information, please do let me know.
Just to mention, my form does indeed have :remote => 'true' set.
Thank you for your assistance in advance.