This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Getting the selected option text  RSS feed

 
Al Razor
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a dropdown (combo box) in the .jsp page of my Liferay portlet, in my Java code I can get the selected value using request.getParameter("DROPDOWN_NAME"); in processAction method.
My question is: how can I get the selected text (the one between the option tags) in the Java code?

Thanks for any help!
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66141
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't. That information is not submitted as part of the request.

If you really need it, you can use JavaScript to copy the value into a hidden input that can be submitted.
 
Al Razor
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:You can't. That information is not submitted as part of the request.

If you really need it, you can use JavaScript to copy the value into a hidden input that can be submitted.


Thank you for your answer, Bear!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!