wood burning stoves 2.0*
The moose likes Struts and the fly likes new to struts - selected item from drop down list Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "new to struts - selected item from drop down list" Watch "new to struts - selected item from drop down list" New topic
Author

new to struts - selected item from drop down list

beth ana
Greenhorn

Joined: Jul 07, 2004
Posts: 11
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

Joined: Jan 10, 2002
Posts: 61095
    
  66

Moving to the Frameworks forum.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30377
    
150

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.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
beth ana
Greenhorn

Joined: Jul 07, 2004
Posts: 11
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

Joined: Jan 10, 2004
Posts: 6
May you can use javascript.


I help you , You help me!!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: new to struts - selected item from drop down list