Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Multiple selection in drop down list

 
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> & <html:optionCollections>/<html:options> 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.
 
Ranch Hand
Posts: 349
Hibernate Eclipse IDE 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.
 
Rancher
Posts: 377
Android Spring Java
  • 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 Spring Java
  • 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 Spring Java
  • 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
    Bookmark Topic Watch Topic
  • New Topic