I want when I enter the login, the other form appears but it appears for a second frame and disappears, why ?? Anybody help me please?
<html>
<head>
</head>
<body>
<form onsubmit="return Verifica(this)">
<span> Login:</span><input type="text" value="" name="usuario" id="login" >
<span> Senha:</span> <input type="password" name="senha" value="" id="senha" >
<input type="submit">
</form>
<script>
function Verifica(form){
var user = form.usuario.value;
var pass = form.senha.value;
if( user == "1" && pass == "2"){
alert("Sucesso");
Visible();
}else{
alert("Falho");
return false;
}
}
function Visible(){
document.getElementById("tipo").style.visibility = "visible";
document.getElementsByName("raca").style.visibility = "visible";
document.getElementByName("descricao").style.visibility = "visible";
document.getElementsByName("submit").style.visibility = "visible";
document.getElementById("login").style.visibility = "hidden";
document.getElementsById("senha").style.visibility = "hidden";
}
</script>
<form action="cad.php" method="post" name="form">
<input type="text" id="tipo" name="tipo" value="" style="visibility: hidden;" >
<input type="text" name="raca" value="" style="visibility: hidden;">
<textarea name="area" style="visibility: hidden;"><input type="text" name="descricao" value=""></textarea>
<input type="submit" name="submit" value="submit" style="visibility: hidden;">
</form>
<script>
function Visible(){
document.getElementById("tipo").style.visibility = "visible";
document.getElementsByName("raca").style.visibility = "visible";
document.getElementByName("descricao").style.visibility = "visible";
document.getElementsByName("submit").style.visibility = "visible";
document.getElementByName("usuario").style.visibility = "hidden";
document.getElementsByName("senha").style.visibility = "hidden";
}
</script>
</body>
</html>