Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>Vários inputs</title>
- <script>
- function processaResposta(){
- var oSumario, oDetalhe, oSectionFeedback;
- oSumario = document.getElementById("idTSumario");
- oDetalhe = document.getElementById("idTaDetalhe");
- oSectionFeedback = document.getElementById("idSectionFeedback");
- //TODO: controlo de qualidade
- var strSumario = oSumario.value;
- var strDetalhe = oDetalhe.value;
- if (oSectionFeedback!=null){
- var strResposta="Sumário: "+strSumario;
- strResposta+="<br>";
- strResposta+="Detalhe:<br><cite>";
- strResposta+=strDetalhe+"</cite>";
- oSectionFeedback.innerHTML = strResposta;
- }
- }//processaResposta
- </script>
- </head>
- <body>
- <h1>O meu diário</h1>
- <form action="javascript:processaResposta();">
- <label for="idTSumario">Sumário do dia:</label>
- <br>
- <input
- size="40"
- id="idTSumario"
- type="text"
- placeholder="sumário de como correu o dia"
- >
- <br>
- <label for="idTaDetalhe">Elabora:</label><br>
- <!-- value não estabelece o valor de uma textarea-->
- <textarea
- id="idTaDetalhe"
- cols="30"
- rows="4"
- placeholder="elabora sobre o como dia te correu"
- value="valor por defeito IGNORADO"
- >Começa a escrever aqui.</textarea>
- <br>
- <input type="reset" value="repôr valores">
- <br>
- <input type="submit" value="registar o dia">
- </form>
- <hr>
- <section id="idSectionFeedback"></section>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement