• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

new to struts - selected item from drop down list

 
beth ana
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
How do i find the selected value in a drop down list? based on the selected option I want to set a message from the properties file.

Any help is appreciated.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64959
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to the Frameworks forum.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34669
366
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Beth,
In your action, you can get the ActionForm. It's getXXX() method will tell you what the value is set to for the field before the JSP is loaded.
 
beth ana
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But, I have not yet submitted the form. I need to find the selected value onload and also onchange and display the coresponding description field in the same page.
 
Guiqiang Zhang
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
May you can use javascript.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic