I have a html form which collects data in input elements and then generates a PDF (using jsPDF) for the user to download (using Downloadify js). The data collected contains personal information.
What I need to know is will the data entered into the input elements, which then gets processed by JavaScript, remain in browser memory when the user navigates elsewhere or closes the browser window?
Yes it will probably remain in memory for a period. This is beyond you control, and will differ between browsers and operating systems.
If your form is not actually submitted to the server, autocomplete should not store it, although you may want to add autocomplete="off"
to be extra sure of this.
You could also use JavaScript to set the form values to blank once processing is done.
document.getElementById('name').value = '';
You could also set any JavaScript objects to null after use. This will not guarantee that the data would not be held in memory somewhere. You could encourage users to close all browser windows after use and logout of the operating system if this is a concern. Browsers such as Chrome can remain in memory even though all windows are closed as it can live in the system tray if that option is set so logging out will force it to close whilst being easy for users to do.
Yes. The form data is saved in browser memory even if the user navigates to other page or closes the tab. It will saved in temporary browser auto-fill cache. You can disable this by using the attribute autocomplete="off"
for form elements.
You can find more about autocomplete attribute here:
http://www.w3schools.com/tags/att_input_autocomplete.asp