This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
    Bookmark Topic Watch Topic
  • New Topic

struts2: how to create dynamic input field?

 
hans meiser
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hi guys.

I would like to create a Form where a user can enter a text, and then enter multiple buzzwords which match to the text.

My first Idea was to make a input field and to write, that the user has to seperate each buzzword with a ; in the input field. so i could operate with string operations an fill each buzzword into the database.

now my question is, if there is a possibility to make a input form, which generates a new empty input field, if you fill in the first on? so the user can add as many buzzwords as he likes?

this would be easyier to handle for the user.

Thanks for your input!
 
Joe Ess
Bartender
Pie
Posts: 9266
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Report post to moderator
Are you asking how to add the text boxes? That's not a struts problem. You can do that with client-side javascript.
 
hans meiser
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Report post to moderator
Can you tell me how i have to implement this on one JSP site? how can i use the stored values after that in my action class?

It would be very helpful, if you could post a short example?

Thank you very much...
 
Joe Ess
Bartender
Pie
Posts: 9266
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Report post to moderator
You can use javascript in a JSP.
As for getting the information to an action, I assume one would use an indexed property. Our FAQ has an example for Struts 1. This example for Struts 2 is fairly similar.
 
Monica Shiralkar
Ranch Hand
Posts: 842
1
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hi,

I have similar kind of problem

I tried the below:




Idea is to use same name in Action Class property.
The above works but below does not:





Now I would use the name EmailId1 as property but the above does not work.Please advice.

Thanks.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64712
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please do not post the same question more than once.
 
    Bookmark Topic Watch Topic
  • New Topic