This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv 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 REST with Spring (video course) this week in the Spring 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: 63548

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

[Asking smart questions] [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
It's not a secret anymore!