How to take updated input value and send to another html page

Asked

Viewed 56 times

0

Good morning, everyone,

I’m taking the data from a form as follows:

function save(){
    window.localStorage.setItem('nome', $('#nome').val());
    window.localStorage.setItem('sobrenome', $('#sobrenome').val());
    window.localStorage.setItem('email', $('#email').val());
}
function load(){
    $('#nome').val(window.localStorage.getItem('nome'));
    $('#sobrenome').val(window.localStorage.getItem('sobrenome'));
    $('#email').val(window.localStorage.getItem('email'));
}

and in html

Pag1:

<body onload="save()" onunload="save()">

in pag2

<body onload="load()">

The problem is that on the second page the values cannot be changed, would there be any way to change the values? and if necessary manage to send to another page the changed values "to a third page"?

  • He was very confused to understand Vagner!

  • I have three pages the first is a form that will pass the information to the second page the second page receives the information from the first form with the option to edit the information and send to the third page but the way I did the pages receive the data but cannot change

  • But for that then take the values if you will change them?

  • This is only an option if you want to change them if the data will not be sent as it came, it serves to help the user only...

  • Got it, Vagner vc can change the value of the localStorage normally, just put it in a variable and change its value.

  • In case you would have to create another form on the second page so that the user can change the information.

  • I managed to resolve thanks

Show 2 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.