This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes To add a control in JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "To add a control in JSP" Watch "To add a control in JSP" New topic

To add a control in JSP

Abin Thomas

Joined: Dec 21, 2006
Posts: 3
Heelo, is it possible to add a control dynamically in a jsp page.
i uses a text box and if i enter a string another text box has to be added near to the first one else a combo box has to be added. is it possible.
Jaikiran Pai

Joined: Jul 20, 2005
Posts: 9955

Can be done using Javascript

[My Blog] [JavaRanch Journal]
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 60802

The fact that you are in a JSP is moot as all this occurs on the client.

You can either create and remove the elements under Javascript control as appropriate by using DOM manipulation, or if you know what you need in advance, create all of the elements up front and hide and show them as approrpiate.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
It is sorta covered in the JavaRanch Style Guide.
subject: To add a control in JSP
Similar Threads
How do i create dynamic input fields after click a button?
JSP from Java Object
Is it possible to pass a value from JSP to Javascript
Dynamic adding
cloning labels