Saving form choices

Hi, I am working on a questionnaire with text fields and single and multiple choice options.
I need some help on how to

  1. Save the written texts and chosen lines locally. The user can close and open the form without losing the chosen answers.
  2. Create a summary scene with all written texts and chosen lines in text form.
  3. Send the summary to a database and keep it updated.
    It could have a function that changes the attribute value of the chosen lines from 0 to 1 and another one that copies all flagged lines to the summary.
    The js developer suggested the possibility of writing the js code directly on the exported html file but I don't think it is the best approach.
    Thanks! (637.8 KB)

There's a large variety of ways to do this, and the best technique probably depends on your overall goals.

In general, I don't think you need to modify the export HTML, instead you could definitely add code to an On Scene Load handler or even in the Head HTML (via the document inspector) if need be.

For local storage, you may want to take a look at the... appropriately named localStorage APIs.

For sending to a database, that will of course require more on the database side. You'd normally communicate to APIs via an XMLHTTPRequest.

Thank you very much Jonathan

1 Like