Auto Save Form with User Input fields

I am new at using Corvid, I have been able to browse the API and the forum but I haven’t been able to find a solution. Here is what I am trying to accomplish:

  • I have a very long form with user fields connected to a dataset (which has a reference field to the members’ collection).
  • In order to avoid a member inserting a line in the collection, I was going to manually add the item for them, through the dashboard, each time I want a new form filled (Small volume).
  • I have managed to add a dropdown where the user could select the item (which is the only item them would have access to).
    ***** Issue #1: I’d like the item to be preselected so that the user does not have to select it.
    ***** Issue #2: the selection does not affect the value of my other user input fields on my page. I need the values of the item loaded in the respective user input fields.
    ***** Issue #3: Since it is a very long form, I’d like the user to be able to save while they fill it out. Ideally an autosave on itemvaluechanged. Otherwise a button to update the item, but the problem is that if I add a button for them to save the item, the fields values dissapear and as per issue #2 I cannot load the values back into the fields.

Hi,
I will address your questions one by one:
1. You can set the value of the dropdown in the onReady function, so that when the page loads it’s already selected. Example:

$w.onReady(function () {
$w("#myDropdown").selectedIndex = 0;
});

To set one of the options to be selected, set the selectedIndex property to an index between 0 and options.length - 1. Click here to learn more.
2. If you wish the fields to have the default values according to the selection, you can add the onChange event for the dropdown. When another value is selected you need to query the database and set the relevant fields to the relevant values.
3. You can save inputs with specified time interval by adding a function which saves data into storage and executing it with a specified time interval. Then, when the page loads (inside onReady function) you can check if there is any data in storage and populate fields with it if needed. You can also clear the storage when your users click the submit button.

I’m trying to do this, but I have no idea how to turn what you said into working code, could you give me an example of how to save storage into data and how to check and populate