I am creating a Sample Registration form using HTML and JS. After filling out all the fields in the form, I have a href link, on clicking it, takes to new HTMl page for uploading documents and on clicking a button in the upload page...it then re-directs to the form page. But the form page gets reloaded and so I am losing all the values given as input.
Asked
Active
Viewed 183 times
4
-
Maybe opening new page for uploading documents in new tab would help? – Arminas Šaltenis May 28 '20 at 11:07
-
2provide us code if possible – Avinash Dalvi May 28 '20 at 11:07
-
Use localStorage instead or put the information in the link and then parse the link when you load the new page. – SRR May 28 '20 at 11:49
1 Answers
2
Here's one way you can do this :
In the JavaScript of the first HTML file (where you get the data):
localStorage.setItem('variable',value)
and then retrieve it from another JavaScript file:
localStorage.getItem('variable')
Another approach:

Roberto Caboni
- 7,252
- 10
- 25
- 39

ssomename
- 505
- 6
- 21