I have problems to do what they are asking me, in terms of creating an agenda, they ask me to create a page where there is a send button that will make the first data that it receives become the username and password to access to the next part of my agenda, what happens that as soon as I try to do this I only manage to do something that is constantly being replaced, I do not know how to create this action so that the first time the user is saved and password, the boxes are cleaned and then I have to put the data of my first entry to access otherwise I have to leave a user message or invalid keys. They also ask me for other validations, but the most important thing I want to learn is the registry that is not replaced with the new values that I put, as a last thing you should also redirect to the page of the form when the start data is correct. (This function has not been explained to me by my teacher so I ask for help, sorry if it is very foolish of me but I have no idea how to do it).
Here I will leave some code that was thinking how to do it.
I will also leave some images of the statement that they provided me just in case I have not explained myself well. . < a href="https://i.stack.imgur.com/Qy4Ll.png">
Java Script
function enviar()
{
let nombre=document.getElementById("nombre").value;
let clave=document.getElementById("clave").value;
if(nombre.length < 1 || clave.length < 1)
alert("Complete correctamente los campos");
else{
alert("Usuario Registrado");
document.getElementById("nombre").value = "";
document.getElementById("nombre").value = "";
var rnombre=nombre;
var rclave=clave;
}
if(nombre!=rnombre || clave!=rclave){
alert("nombre de usuario o clave incorrecta");
}
}