Guest User

Untitled

a guest
Aug 19th, 2018
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 KB | None | 0 0
  1. <html>
  2. <header>
  3. <script language="javascript" type="text/javascript">
  4. function validar() {
  5. var nome = form1.nome.value;
  6. var email = form1.email.value;
  7. var cargo = form1.cargo.value;
  8. var data = form1.data.value;
  9.  
  10. if (nome == "") {
  11. alert('Preencha o campo com seu nome');
  12. form1.nome.focus();
  13. return false;}
  14.  
  15. if (nome.length < 5) {
  16. alert('Digite seu nome completo');
  17. form1.nome.focus();
  18. return false;}
  19.  
  20. if (email == "") {
  21. alert('Preencha o campo com seu email');
  22. form1.email.focus();
  23. return false;}
  24.  
  25. if (email.length < 5) {
  26. alert('Digite seu e-mail completo');
  27. form1.email.focus();
  28. return false;}
  29.  
  30. if (data == "") {
  31. alert('Preencha o campo com sua data de Aniversário');
  32. form1.nome.focus();
  33. return false;}
  34.  
  35. if (cargo == "") {
  36. alert('Preencha o campo com seu Cargo na Empresa');
  37. form1.cargo.focus();
  38. return false;}
  39.  
  40. return true;
  41.  
  42. }
  43. </script>
  44. </header>
  45.  
  46. <body>
  47. <form name="form1" action="enviar.php" method="post">
  48. <p> Formulário de Cadastro </p>
  49. <p>Nome do Candidato: <input type="text" name="nome"></p>
  50. <p>Data Nascimento: <input type="date" name="data"></p>
  51. <p>E-mail: <input type="email" name="email"></p>
  52. <p>Cargo Candidato:
  53. <select name="cargo">
  54. <option></option>
  55. <option> Estagiário </option>
  56. <option>Programador</option>
  57. <option>Analista de Software</option>
  58. <option> Gerente de Projeto</option>
  59. <option> Arquiteto de Software</option>
  60. </select>
  61. </p>
  62. <input type="submit" onclick="return validar()">
  63. </form>
  64. </body>
  65. </html>
Add Comment
Please, Sign In to add comment