• 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Tim Cooke
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
  • Piet Souris
Bartenders:
  • Stephan van Hulst

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]
 
Right! We're on it! Let's get to work tiny ad!
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic