1
I need help finishing function logic:
<form name="form1" onsubmit="submeter()">
Nome: <input type="text" id="nome" value="" onkeyup="validarNome()"/><br/><br/>
Idade: <input type="text" id="idade" value="" onkeyup="validarIdade()"/><br/><br/>
<input type="submit" value="Salvar" onclick="salvar()"/><br/><br/>
</form>
<script>
function salvar(){
var Nomes = new Array();
Nomes[i] = document.getElementById("nome").value;
localStorage["Nomes"] = JSON.stringify(Nomes);
}
</script>
Describe your problem/need better.
– user21448
I need a javascript code that saves all name data into one vector and the age data into another vector in Local Storage. And that when making a new registration, the old data are not erased, but accumulated in the vector.
– Pedro