-2

Can any one assist me am trying to populate a dropdown box with data in my database using jstl but unable to get the solution. below is my code

SELECT MarketPlace from tblmarketplace

 <c:forEach var = "row" items = "${carsList1.rows}">

          <c:set var="MarketPlace" value="${row.MarketPlace}"/>



     </c:forEach>

Payment Method

  <option style="width : 150px;" rows="6"  value="CASH">CASH</option>
   <option style="width : 150px;" rows="6"items="${MarketPlace}">${MarketPlace}</option></select><br><br>
Ayo
  • 7
  • 3

1 Answers1

0

Try this...

<select style="width: 143px" name="MarketPlace">
     <c:forEach var="car" items="${carsList1.rows}">
          <option value="${car.xxxxxx}"/>
                ${car.xxxxxx}
          </option>
     </c:forEach>
</select>

xxxxx is the name of field to show.

MG_Bautista
  • 2,593
  • 2
  • 18
  • 33