This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes JSP and the fly likes How to retrieve the values of dynamically created text boxes in jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "How to retrieve the values of dynamically created text boxes in jsp" Watch "How to retrieve the values of dynamically created text boxes in jsp" New topic
Author

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

sourav koner
Greenhorn

Joined: Sep 05, 2007
Posts: 1
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

Joined: Jan 10, 2002
Posts: 61071
    
  66

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: How to retrieve the values of dynamically created text boxes in jsp