0

I need to generate tabindex for required elements in a table as the rows generate from foreach loop with three element in a row...

<table id="cart-table" class="form-group mb0 center-al check-number" role="grid">
<c:forEach items="${xyz.abc}" var="entry" varStatus="status">
<tr class="entry-row">
        <td class="col-product-reason">
            <select id="select${entry.index}"   class="form-control" >
                <option value="${entry.displayCode}">
                    ${entry.displayValue}
                </option>
            </select>
        </td>
        <td class="col-product-quantity">
            <span><input type="text" id="quantity1-${entry.index}" class="small-input form-control"/></span>
            <span><input type="text" id="quantity2-${entry.index}" class="small-input form-control"/></span>
        </td>
</tr>
</c:forEach>
</table>

This is my code snippet, i have tried myself to generate tabindex in the following way

<tr><td><select tabindex="0">//options</select></td><td><input type="text" tabindex="1"/><input type="text" tabindex="2"/></td></tr>
<tr><td><select tabindex="3">//options</select></td><td><input type="text" tabindex="4"/><input type="text" tabindex="5"/></td></tr>
<tr><td><select tabindex="6">//options</select></td><td><input type="text" tabindex="7"/><input type="text" tabindex="8"/></td></tr>

But i couldn't come up with a logic to solve this.. Please provide me with any ideas

Amirtha Rajan
  • 605
  • 10
  • 19

1 Answers1

0

Simply add <td><c:out value="${status.count}" /></td> after <tr class="entry-row">.

parlad
  • 1,143
  • 4
  • 23
  • 42