Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

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

 
Greenhorn
Posts: 1
  • 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> <c:out value="${item.productInterest.transactionstatus}"/></td>
<td> <c:out value="${item.contactInfo.name}"/></td>
<td> <c:out value="${item.product.name}"/></td>
<td> <c:out value="${item.product.unitprice}"/></td>
<td> <input type="text" id="price" /></td>


Kindly help me.
 
Marshal
Posts: 67425
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • 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.
 
Hot dog! An advertiser loves us THIS much:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic