• 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
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

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]
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic