elizeub

HTML e jQuery

Jun 21st, 2016 (edited)
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.04 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8" />
  5. <title></title>
  6. <!-- Aqui dentro do head insiro o código da biblioteca jquery -->
  7. <script src="https://code.jquery.com/jquery-1.12.4.js"
  8. integrity="sha256-Qw82+bXyGq6MydymqBxNPYTaUXXq7c8v3CwiYwLLNXU="
  9. crossorigin="anonymous">
  10. </script>
  11.  
  12. <!-- Script de confirmação de envio -->
  13. <script language="JavaScript">
  14. function pergunta(){
  15.    if (confirm('Tem certeza que quer enviar este formulário?')){
  16.       document.seuformulario.submit()
  17.    }
  18. }
  19. </script>
  20.  
  21. </head>
  22. <body>
  23. <form action="index.php" method="post" enctype="text/plain">
  24. <label>Nome: <input type="text" name="nome" id="nome"></label><br>
  25.  
  26. <label>Idade: <input type="text" name="Idade" id="idade"></label><br>
  27.  
  28. <input type="submit" name="submit" onclick="pergunta()" id="submit">
  29. </form>
  30.  
  31. <?php
  32.  
  33.  
  34.  
  35. if(isset($_POST['submit'])){
  36.  
  37.  
  38.    if(isset($_POST['nome'])){
  39.        $nome = $_POST['nome'];
  40.    }
  41.    
  42.    if(isset($_POST['idade'])){
  43.        $nome = $_POST['idade'];
  44.    }
  45.    
  46. ?>  
  47.  
  48. </body>
  49. </html>
Add Comment
Please, Sign In to add comment