Field Alert

0

Talk the guys. I have a question, I would like to know how I can display an alert Div next to an input if this field is not filled or the data already exists in the database. '

        <form action="Cadastrado.php" method="POST">


            <input type="text" name="nome" placeholder="Nome" class="nome" id="nometeste" >


            <input type="text" name="sobrenome" placeholder="Sobrenome" class="sobrenome" >


            <input type="text" name="login" placeholder="Email" class="login" maxlength="40" >


            <input type="password" name="senha" placeholder="Senha" class="senha" maxlength="30" >

            <input type="submit" value="Cadastrar" class="botao">

        </form>

        </div>'
    
asked by anonymous 25.07.2016 / 04:53

1 answer

0

To require the fields to be filled you can add required to the input. It would look like this:

<input type="text" name="nome" placeholder="Nome" class="nome" id="nometeste" required>
    
25.07.2016 / 13:18