Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

154
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!