Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

159
Vistas
EJS console.log() does print correctly, but it doesn't while writing it to the table

Good Day everybody

If i use a console.log it prints it correctly, but it doesn't write it to a table. And i have no idea why it doesn't. Can someone help me please?

My EJS looks like this:

<% insrtdJngls.forEach((item) => { %>
                        <tr></tr>
                            <% console.log(item, "ejs print") %>
                            <% console.log(item.insrtdDateiname, "ejs print") %>
                            <td id="table_firma" class="tdList"><%=item.insrtdFirmaname%></td>
                            <td id="dateiname_table" class="tdList"><%=item.insrtdDateiname%></td>
                            <td id="table_time" class="tdList"><%=item.insrtdDateTime%></td>

                            <form method="post" action="/deleteOne">
                                <td><button class="DelOne"><img
                                            src="https://img.icons8.com/ios/25/000000/empty-trash.png" /></button></td>
                            </form>

                            <form method="post" action="/deleteAll">
                                <td><button class="DelAllBtn"><img
                                            src="https://img.icons8.com/fluency-systems-regular/25/000000/garbage-truck.png" /></button>
                                </td>
                            </form>
                            <% }); %>

And my ejs print looks like this:

{
  insrtdDateTime: 2022-01-12T01:18:00.000Z,
  insrtdDateiname: 'fantaWerbung',
  insrtdFirmaname: 'Fanta'
} ejs print
fantaWerbung ejs print
{
  insrtdDateTime: 2022-01-13T01:18:00.000Z,
  insrtdDateiname: 'fantaWerbung',
  insrtdFirmaname: 'Fanta'
} ejs print
fantaWerbung ejs print

But in the td, there is no output at all... if i write it with just item, it shows me, that there is one object, can someone explain?

Why doesn't it write to the table like fantaWerbung? Because obviously the data it receives is correct...

Thanks a lot Mats Groeneweg

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Place form inside the td:

<table>
<tbody>
<% insrtdJngls.forEach((item) => { %>
                        <tr>
                            <% console.log(item, "ejs print") %>
                            <% console.log(item.insrtdDateiname, "ejs print") %>
                            <td id="table_firma" class="tdList"><%=item.insrtdFirmaname%></td>
                            <td id="dateiname_table" class="tdList"><%=item.insrtdDateiname%></td>
                            <td id="table_time" class="tdList"><%=item.insrtdDateTime%></td>

                            <td>
                            <form method="post" action="/deleteOne">
                                <button class="DelOne"><img
                                            src="https://img.icons8.com/ios/25/000000/empty-trash.png" /></button>
                            </form>
                            </td>

                            <td>
                            <form method="post" action="/deleteAll">
                                <button class="DelAllBtn"><img
                                            src="https://img.icons8.com/fluency-systems-regular/25/000000/garbage-truck.png" /></button>
                                
                            </form>
                            </td>
                            
                            </tr>
                            <% }); %>
</tbody>
</table>
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda