I can not make the register button

2

I can not make the register button the way I want it. I have my normal logon button but when I click on the log it gives the same login fields. Also have a little JavaScript.

<!---- Botão do iniciar sessão--->
<button class="login"  onclick="document.getElementById('id01').style.display='block'"  style="border:2px solid black; width:auto; border-radius:10%;" ><i class="fa fa-user">Iniciar Sessão</i></button>


    <div id="id01" class="modal">

                <form class="modal-content animate" action="indexlogin.php"   method="post" >


        <div class="container">
                        <label><b>Email</b></label>
                            <input  id="field"type="text" name="email"style="border:1px solid black; width:auto;" placeholder="Email" required>

                        <label><b>Palavra-Passe</b></label>
                            <input  id="field" type="password" name="password"style="border:1px solid black; width:auto;" placeholder="Palavra-Passe"required>

                        <button  id="field" type="submit"  name="login" style="border:1px solid black; width:200px;" >Entrar</button>
        </div>



                <div class="container" style="background-color: #adad85">
                        <button type="button" onclick="document.getElementById('id01').style.display='none'" action="indexlogin.php" style=" border:1px solid black; width:auto; border-radius:10%;" class="cancelarbotao">Cancelar</button>
                </div>

                </form>
    </div>  
    <!---Fim do botão do iniciar sessão --->

    <!--- Botão de registar---->
                <button class="registar"  onclick="document.getElementById('id01').style.display='block'" style="border:2px solid black;  border-radius:10%;" > <i class="fa fa-user-plus">Registar</i></button>

    <div id="id2" class="modal">

                <form class="modal-content animate" action="indexlogin.php"   method="post" >


        <div class="container">


                            <input  id="field"  type="name"     name="nome"style="border:1px solid black; width:auto;" placeholder="Nome Completo" required>

                            <input  id="field"type="text"       name="email_registar"style="border:1px solid black; width:auto;" placeholder="Email" required>

                            <input  id="field" type="password"  name="password_registar"style="border:1px solid black; width:auto;" placeholder="Palavra-Passe"required>

                            <input  id="field" type="password"  name="password_rep"style="border:1px solid black; width:auto;" placeholder="Palavra-Passe"required>

                            <input  id="field" type="submit"    name="registar" style="border:1px solid black; width:200px;" >Criar Conta</button>
        </div>



                <div class="container" style="background-color: #adad85">
                        <button type="button" onclick="document.getElementById('id01').style.display='none'" style=" border:1px solid black; width:auto; border-radius:10%;" class="cancelarbotao">Cancelar</button>
                </div>

                </form>
    </div>  
    <!---fim do botão do login--->



<script>
var modal = document.getElementById('id01');

window.onclick = function(event) {
    if (event.target == modal) {
        modal.style.display = "none";
    }
}
</script>
    
asked by anonymous 04.06.2018 / 10:25

1 answer

2

change this line:

<button class="registar"  onclick="document.getElementById('id2').style.display='block'" style="border:2px solid black;  border-radius:10%;" > <i class="fa fa-user-plus">Registar</i></button>

Before the document.getElementById ('') was id01, put the id2 that is your div

    
04.06.2018 / 10:37