Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

To add a control in JSP

 
Abin Thomas
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Heelo, is it possible to add a control dynamically in a jsp page.
exampl
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
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can be done using Javascript
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64827
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic