I have a web form #form1 and many elements are dynamically created, therefor I can't just use searialize. I want to store the form input in localstorage so that when the user submits the form, they can hit the back button, and I can recreate the form 100% where they left off.
This is an internal company tool, nothing super secure required for a public facing site. I want to store the HTML contents from the form including the form itself, that way all dynamic content can be restored.
I've tried $('#form1')[0].outerHTML
$('#form1').content()
and many other options in jQuery, but that doesn't give me any filled form values.
I basically want the evaluated HTML of the form id form1
100% complete, including all filled out data to be stored in a variable in JS.
This is not a duplicate because no other question I've seen anywhere relates to getting a complete HTML element, and all form values stored to a single string for easy restoration later. This is NOT serialization.