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

select all in list box

 
ben oliver
Ranch Hand
Posts: 375
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a struts 2 list box, want to create button or link for "select all items" for user to click and select all the items in the list box. How to do that ? any example ?
 
Roberto Hernandez
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess you'll have to do this with javascript. See this example.
First, make sure you give your listbox an id attribute;


Then, you can invoke this function when the user clicks on the button
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic