I am working on a project where I have a div containing a html table, which in turn contains a header row and any number of table body rows.
The rows that are added contain text areas, text boxes and 7 select inputs.
I need to copy literally everything from the div (including buttons etc outside the tables and all the input values in the textareas and select options) to a string. I do this to add the "snapshot" of the div to a file (Using ActiveXObject in IE11), send it to someone else, they open the file and do the reverse of what I do on my side.
I have an 80% working version of this by using $(divID).html() but this doesn't get the select and text input values.
I have used clone() along with fix clone plugin to attempt this now which works well in it's own right (gets everything and when I append to body it makes a perfect copy) but I can't seem to get the object created to string format and back again (object -> text file -> other user -> text file -> object).
Is this possible?
The reason I need to have the data in text format is because I need to be able to transfer my complete "session" to another user and this file needs to be saved to a sharepoint library so it can be accessed. The only way I can get the file to the library at the moment is by sending via email to the library(not capable enough to use js to get file to library right now).
Would I be better off loop through each element on the page and putting everything in JSON format? I'm very new to js and learning as I go.
All suggestions welcome.