1 Answer
  • 0

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 191


File: /var/www/html/cnasolution/application/views/question.php
Line: 191
Function: _error_handler

File: /var/www/html/cnasolution/application/controllers/Questions.php
Line: 419
Function: view

File: /var/www/html/cnasolution/index.php
Line: 315
Function: require_once

name Punditsdkoslkdosdkoskdo

Issue with accordion in EJS

I'm trying to iterate over my database in EJS, and render them as an Accordion. There are 2 issues here. When I expand an individual accordion, they all expand. To solve this I tried to assign a unique id (by assigning a variable 'i' and then incrementing it at the end of the loop). But this also doesn't seem to work. Not sure what I'm doing wrong here.

Below is my EJS template code.

<% for(let li of list) { %>             <% let i = 0; %>                 

<%= li.body %>
<% i++;%> <% } %>
Download script demo [LINK]
Download script demo [LINK 2] Download script demo [LINK 2]

Are you using Bootstrap ?

Can you inspect and see what id is being added to accordian content div after render. More info is needed to solve this as I can't figure it out.

The data-target of the button should match with the id of the content div. Please verify this and reach again.

see demo
  • 0
Reply Report