Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within JSP
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Tim Cooke
paul wheaton
Ron McLeod
Jeanne Boyarsky
Sheriffs:
Paul Clapham
Saloon Keepers:
Tim Holloway
Roland Mueller
Bartenders:
Forum:
JSP
Dropdownlist value
sumit sharmast
Greenhorn
Posts: 15
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Dear All,
How can I send the value of quantity(droplist list) of below
JSP
to
servlet
(displayCart), please correct.
<jsp:include page="/header.html" /> <td width="570" valign="top" colspan="2"> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <h1></h1> <table cellpadding="5" border="0"> <tr valign="bottom"> <th align="left">Description</th> <th align="left">Price</th> <th align="left">Quantity</th> <th align="left"> </th> </tr> <c:forEach var="product" items="${products}"> <tr valign="top"> <td> ${product.description} </a> </td> <td>${product.priceCurrencyFormat}</td> <td><select name="quantity"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4 </option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8 </option> <option value="9">9</option> <option value="10">10</option> </select> </td> <td> <td width="179"> <img src="${product.imageURL}" width="175" height="175"> </td> <td> <a href=" <c:url value='/cart/displayCart?productCode=${product.code}'/>"> Add to cart </a></td> </tr> </c:forEach> </table> </td> <!-- end middle column -->
sonu raj
Ranch Hand
Posts: 43
I like...
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
This may help. The edited part is highlighted
<jsp:include page="/header.html" />
<td width="570" valign="top" colspan="2">
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<h1></h1>
<form action="displayCart" method="get">
<table cellpadding="5" border="0">
<tr valign="bottom">
<th align="left">Description</th>
<th align="left">Price</th>
<th align="left">Quantity</th>
<th align="left"> </th>
</tr>
<c:forEach var="product" items="${products}">
<tr valign="top">
<td>
${product.description}
</a>
</td>
<td>${product.priceCurrencyFormat}</td>
<td><select name="quantity">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4 </option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8 </option>
<option value="9">9</option>
<option value="10">10</option>
</select>
</td>
<td>
<td width="179">
<img src="${product.imageURL}" width="175" height="175">
</td>
<td>
<a href="
<c:url value='/cart/displayCart?productCode=${product.code}'/>">
<input type="submit" value="Add to cart" >
</a></td>
</form>
</tr>
</c:forEach>
</table>
</td>
Normally trees don't drive trucks. Does this tiny ad have a license?
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
JSP Error
Doubts in jsp
How to getParameter value
Redirecting a page
How can i get selected radio button value using jsp
More...