luistavares

HTML - Validação de Formulário

Sep 16th, 2021
1,097
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <html lang='pt-br'>
  2.     <head>
  3.         <meta charset='UTF-8'>
  4.         <title>Validação</title>
  5.     </head>
  6.     <body>
  7.         <h3>Usando atributos HTML para validar formulário</h3>
  8.         <form action="processa.php" method="post">
  9.             <label>Nome: </label><br>
  10.             <input type="text" name="nome" required><br>
  11.             <label>E-mail: </label><br>
  12.             <input type="email" name="email" required><br> 
  13.             <label>Número de dependentes: </label><br>
  14.             <input type="number" min="0" max="20" name="dep" required><br>
  15.             <label>Data Nascimento: </label><br>
  16.             <input type="date" name="nasc" required><br>
  17.             <label>CPF: </label><br>
  18.             <input type="text" name="cpf"
  19.                 pattern="\d{3}\.\d{3}\.\d{3}-\d{2}"
  20.                 title="Digite o CPF no formato XXX.XXX.XXX-XX" required><br><br>
  21.             <button type="submit">Enviar</button>
  22.         </form>
  23.     </body>
  24. </html>
RAW Paste Data