I have a dynamic page with a bunch inputs (text, URL, etc) that go to a database. I want to make an auto save function, that saves all inputs every couple of minutes. I have tried many code examples for the past week and can’t get this to work. Can someone please give examples of code?
Thanks.
1 Like
If you would like a “autosave” feature to function on a regular time interval, you could use setInterval() to detect if there are any changes between the object received from your dynamic dataset and whatever the user currently has entered on the page in the input elements.
Example
$w.onReady(function () {
let recurring = setInterval(() => {
//Check if any changes between input element data and current collection object
console.log("This message will print in the developer console every minute.")
}, 60000)
});
The exact implementation depends on how you update your collection data (whether it uses the Dynamic Dataset API or the Wix Data API).