• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Getting values from a multiselect box?

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I'm trying to use this.request.getParameterValues("fieldname") to get the values returned by a multiple-select enabled field. For some reason, it always returns null (which should only happen if the field name does not exist). I've tried using this.request.getParameter("fieldname") to test this, and it successfully returns one of the selected values. Any ideas about why getParameterValues would fail?

Thanks,
Derek
[originally posted on jforum.net by derekoneil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I worked around this by creating a hidden input field and using a js function to populate its value with the selected options in the multiselect. Then i can use getParameter("fieldname") to get that single (but combined) value.

I would still like to know why getParameterValues() doesn't work, though, if anybody has any ideas.
[originally posted on jforum.net by derekoneil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It was supposed to work, as, for example, the mass delete of private messages (PrivateMessageAction.java) uses it. If you look at the source code, you will also see that, until version 2.1.7, JForum does not even override the method (e.g, it used the default implementation)

Rafael
[originally posted on jforum.net by Rafael Steil]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic