0
I am a beginner in Nodejs and am responsible for a project in this tool. I am using the "EJS" engine to create the views. I created a form, to send the information typed by the user, for a route and this route I process the information and return a reply to this html/ejs page, but I do not know how to proceed with the implementation. Follow the code below the html/ejs page and the file code referring to my application routes.
artwork_1.ejs
<html>
  <head>
    <title>Página de Conversação</title>
    <link rel='stylesheet' href='/stylesheets/style.css' />
  </head>
  <body>
    <h3><%= artwork %></h3>
    <img src="images/IMG01.jpg" alt="Imagem da Obra de Arte 1" title="Obra de Arte 1"></br>
    <div id="divChat">
    </div>
    <form>
        <input type="text" name="question" placeholder="Pergunte-me" required />
        <button>Enviar</button>
    </form>
  </body>
</html>
index js.
const express = require('express');
const router = express.Router();
/* GET home page. */
router.get('/', function(req, res, next) {
  res.render('index', { title: "Página Inicial" });
});
router.get('/artwork-1', function(req, res){
  res.render('artwork_1', { artwork: "Obra 1" });
});
module.exports = router;

Want to send without reloading the page or reload the page?
– Sergio
@Sergio good, the ideal is that you didn’t need to reload the page, but if that’s not possible then you can reload the page instead. Do you know any way?
– CloudAC
Take a look here: https://answall.com/a/6634/129 The solution with ajax is what you need. And then use this solution here: https://answall.com/a/146751/129
– Sergio
I will test the solutions you gave me. Thank you for responding!
– CloudAC