• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to retrieve the values of dynamically created text boxes in jsp

 
sourav koner
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI, ALL

I am dynamically genearting text boxes on jsp. How do I access selected values in my action class when user clicks submit?

Following is my jsp.

<tr>
<th>Buyer</th>
<th>Transaction ID</th>
<th>Transaction Status</th>
<th>Name</th>
<th>Title</th>
<th>Unit Price</th>
<th>Enter Price</th>


</tr>

<c:forEach var="item" items="${plistname}"><tr>
<td> <c ut value="${item.productInterest.buyer}"/></td>
<td> <c ut value="${item.productInterest.transactionid}"/></td>
<td> <cut value="${item.productInterest.transactionstatus}"/></td>
<td> <cut value="${item.contactInfo.name}"/></td>
<td> <cut value="${item.product.name}"/></td>
<td> <cut value="${item.product.unitprice}"/></td>
<td> <input type="text" id="price" /></td>


Kindly help me.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64171
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have not given your text boxes names. Without names, the values will not be submitted as part of the request.

Once the controls have names, you would fetch their values using the usual mechanisms. The fact they were "dynamically created" as part of the original JSP is moot.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic