Asking a question
I have a multi-page survey, and I need the user to specify files to be uploaded (on survey completion) in one of the pages. My idea was to use an HTML question-type and then append a custom file uploader to it (the default file question-type doesn't fit my needs) when that HTML question-type is rendered.
However, this approach requires me to append and remove the custom file uploader in order to save the state (i.e. keep list of what files the user wants uploaded). My understanding is that when the page changes, the HTML element is destroyed from the current page and then rendered from scratch again if the user comes back to that page.
I feel like I'm missing an obvious way of doing saving the state. How can I save the state of that custom widget _before_ it's destroyed by other survey events?
I would like to keep the state of the Fine Uploader widget between pages and between toggling of visibility of the HTML question-type.
Tested page URL: N/A
Test code
N/A
Alright, after some random googling I realized that the answer was in my question -- just create a widget!
For others wondering how to do it, you can find an example of creating your own widget here (see the customwidget.js file): https://plnkr.co/edit/HdnYE5?p=preview
Most helpful comment
Alright, after some random googling I realized that the answer was in my question -- just create a widget!
For others wondering how to do it, you can find an example of creating your own widget here (see the customwidget.js file): https://plnkr.co/edit/HdnYE5?p=preview