Advertisement
am_dot_com

SW 2022-03-23

Mar 23rd, 2022 (edited)
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.71 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Vários inputs</title>
  6. <script>
  7. function processaResposta(){
  8. var oSumario, oDetalhe, oSectionFeedback;
  9. oSumario = document.getElementById("idTSumario");
  10. oDetalhe = document.getElementById("idTaDetalhe");
  11. oSectionFeedback = document.getElementById("idSectionFeedback");
  12.  
  13. //TODO: controlo de qualidade
  14.  
  15. var strSumario = oSumario.value;
  16. var strDetalhe = oDetalhe.value;
  17.  
  18. if (oSectionFeedback!=null){
  19. var strResposta="Sumário: "+strSumario;
  20. strResposta+="<br>";
  21. strResposta+="Detalhe:<br><cite>";
  22. strResposta+=strDetalhe+"</cite>";
  23. oSectionFeedback.innerHTML = strResposta;
  24. }
  25.  
  26.  
  27. }//processaResposta
  28. </script>
  29. </head>
  30. <body>
  31. <h1>O meu diário</h1>
  32. <form action="javascript:processaResposta();">
  33. <label for="idTSumario">Sumário do dia:</label>
  34. <br>
  35. <input
  36. size="40"
  37. id="idTSumario"
  38. type="text"
  39. placeholder="sumário de como correu o dia"
  40. >
  41. <br>
  42. <label for="idTaDetalhe">Elabora:</label><br>
  43. <!-- value não estabelece o valor de uma textarea-->
  44. <textarea
  45. id="idTaDetalhe"
  46. cols="30"
  47. rows="4"
  48. placeholder="elabora sobre o como dia te correu"
  49. value="valor por defeito IGNORADO"
  50. >Começa a escrever aqui.</textarea>
  51. <br>
  52.  
  53. <input type="reset" value="repôr valores">
  54. <br>
  55.  
  56. <input type="submit" value="registar o dia">
  57. </form>
  58. <hr>
  59. <section id="idSectionFeedback"></section>
  60. </body>
  61. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement