Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Multiple selection in drop down list

 
Rajagopal Mani
Ranch Hand
Posts: 84
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I can select multiple values in listbox by using <html:select> & <htmlptionCollections>/<htmlptions> tag. But I need to select multiple values from drop down list which means in the drop down list I should able to select multiple values(Becauze dont want multiple lines of listbox). If I use size="1" in <html:select> tag, i can achieve in single line. But it is not look good to select multiple values. I need to do this by using struts or html tag. I am being searched lot in net but did not get any solution. Please help how it can be achieved.

Thanks.
 
Ananth Chellathurai
Ranch Hand
Posts: 349
Eclipse IDE Hibernate Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try something like


Hope this helps
 
Rajagopal Mani
Ranch Hand
Posts: 84
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I need dropdown list instead of listbox. If attribute 'multiple' is used on <html:select> tag, it is converted as listbox not as dropdown list. If attribute 'multiple' is not used, the multiple value selection is not possible. I need to achieve both(*1)

*1
(1) Multiple value selection
(2) dropdown list instead of listbox

Please help to achieve the above.
 
Sean Clark
Rancher
Posts: 377
Android Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey,

You will not be able to do this without the use of javascript as there is no such thing as a multiple selection drop down box in HTML.

Sean
 
Rajagopal Mani
Ranch Hand
Posts: 84
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Thanks for the information. Can you please provide any related link or sample code to achieve this.
 
Sean Clark
Rancher
Posts: 377
Android Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey,

if you use jQuery you can check this: http://code.google.com/p/dropdown-check-list/ otherwise you may just want to search about, a lot of people have asked this question but I couldn't really find any other helpful links.

Sean
 
Rajagopal Mani
Ranch Hand
Posts: 84
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Thanks for the reply. I too found this option during search. I thought to use this if nothing possible by html, javascript & struts. Hope this JQuery option will be pretty good.

Thanks
 
Sean Clark
Rancher
Posts: 377
Android Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
jQuery is JavaScript!
It is just a wrapper around it to make javascript simpler to use, more powerful with the least amount of effort.
See: http://jquery.com/ for more information.

Sean
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic