This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes Dynamic select fields need to add in jsp page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Dynamic select fields need to add in jsp page" Watch "Dynamic select fields need to add in jsp page" New topic

Dynamic select fields need to add in jsp page

Soumya Madhu

Joined: Dec 24, 2008
Posts: 7

I need to create dynamic select fields(<s:select>) when I give a number as input. If I select 3 as input, I need to create 3 select fields in jsp page dynamically. whose field name should be created dynamically.
I am using struts 2 and tomcat 6 and java 1.6.

Can any one help me ?

Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 60740

Please be sure to ask Struts questions in the Struts forum. I have moved this post there for you.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
David Newton

Joined: Sep 29, 2008
Posts: 12617

Just create the HTML that the select tag would render. You might have to play some games to get validation to do what you want, depending on how you're planning on implementing it.
Hebert Coelho
Ranch Hand

Joined: Jul 14, 2010
Posts: 754

Hello Soumya Madhu. What's your real problem?

Do you have any code? Are you receiving some error message or just don't know what to do?

[] [Full WebApplication JSF EJB JPA JAAS with source code to download] One Table Per SubClass [Web/JSF]
I agree. Here's the link:
subject: Dynamic select fields need to add in jsp page
Similar Threads
struts Action for asynchronous HTTP processing
Dynamic field collapse issue in Form
LazyValidatorForm and Lazy DynaBean
Dynamically increased form (Collection)
Dynamically added form fields cannot access from request access