This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Struts and the fly likes select all in list box Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "select all in list box" Watch "select all in list box" New topic

select all in list box

ben oliver
Ranch Hand

Joined: Mar 28, 2006
Posts: 375
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

Joined: Apr 29, 2009
Posts: 33
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
I agree. Here's the link:
subject: select all in list box