Html form data saving problem.. Read description.. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Html form data saving problem.. Read description..

Hey! I have a question for you. I'm making a resume maker website. For entering the details like personal, education, work experience and skills, I have made seperate html pages for each. And for saving each Page's entries, I have made a "Save" Button at the bottom. I want that when we click on the button,an alert should appear " Your data is saved." The problem is I don't know how to save it and show all the data together in the result page. Please help

28th Feb 2022, 1:58 PM
Mansi Kanojia
Mansi Kanojia - avatar
6 Answers
+ 1
Sites like this include backend and sending this data to database. You can somehow trick this, for practice only, and save data in js object for example. So you need when button is clicked to get all value from input fields and store them. When you load another page, you can load same js file, but this time just read data and display to screen. This is not how you would do in normal website. This can easier be done using js frameworks like react, angular or vue.
28th Feb 2022, 2:13 PM
PanicS
PanicS - avatar
+ 1
yes you can save data in form of objects and convert it into JSON form via stringify method JSON.stringify() then you can send data into your local storage use setItem() and fetch data from local storage but in local storage you cannot store data permanently
28th Feb 2022, 3:14 PM
A S Raghuvanshi
A S Raghuvanshi - avatar
+ 1
first sent the data to local storage u can write like this const userdata ={ name : username, password : password, email :useremail } windows.local storage.setItem('user' , JSON.stringify(userdata)); for getting values you can write like this var get = localstorage .getItem('user'); var obj = JSON.parse(get); var storedEmail = obj.email; var storedPassword = obj.password;
28th Feb 2022, 3:31 PM
A S Raghuvanshi
A S Raghuvanshi - avatar
0
PanicS do you mean the real problem is seperate html pages. What if I make multi step in a single page?
28th Feb 2022, 2:38 PM
Mansi Kanojia
Mansi Kanojia - avatar
0
PanicS or can i save each Page's entries in local storage and then show them in the result page
28th Feb 2022, 2:40 PM
Mansi Kanojia
Mansi Kanojia - avatar
0
Then how can I display them in the final html page?
28th Feb 2022, 3:22 PM
Mansi Kanojia
Mansi Kanojia - avatar