Dude I’ll give you a basic example here and hope it helps you.
Page you take the value to transfer to another page:
<input type="text" id="texto">
<a href="mostraDados.html"><button type="button" onclick="setaValor()">Pegar</button></a>
<script>
function setaValor() {
var texto = document.getElementById('texto');
var textoValor = texto.value;
var textoStorage = window.localStorage.setItem('valorTexto', textoValor);
}
</script>
<style>
input { border: solid 1px #ccc; border-radius: 2px; height: 20px; }
button { border: solid 1px #ccc; border-radius: 2px; height: 30px; cursor: pointer;}
</style>
Page that receives the variable with the value of the previous page:
<input type="text" id="recebeTexto"> Valor trazido da página anterior
<br><br>
<a href="setaDados.html"><button type="button">Voltar</button></a>
<script>
function mostraValor() {
var textoRecebido = window.localStorage.getItem('valorTexto');
document.getElementById('recebeTexto').value = textoRecebido;
}
window.onload = function() {
mostraValor();
};
</script>
<style>
input { border: solid 1px red; border-radius: 2px; height: 20px; }
button { border: solid 1px #ccc; border-radius: 2px; height: 30px; cursor: pointer;}
</style>
only with JS??
– Wees Smith
creates an imput Hidden with serializearray value and moves to the next page
– Wees Smith
Yes, it has to be with javascript, you could show me an example?
– Thi100
Already tried with localStorage?
– LeAndrade
No, actually I don’t know how to use the localstorage, can you give me a hand? some example or page that shows me how to use, I searched but did not understand right
– Thi100
I believe the best way for you to do that is with Localstorage. https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API_pt_br/Using_the_Web_Storage_API
– Lucas Brogni