This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes Drop down list action Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Drop down list action" Watch "Drop down list action" New topic

Drop down list action

Satish Kulkarni
Ranch Hand

Joined: Jul 19, 2003
Posts: 60
I have a form with the drop down list of itmes. When a item is selected I want the form to be populated with a certain data.
For example
From a list of user, I select a a user and the user information is loaded. I can edit the user information and submit the form.
How would I achieve this?
Peter Storch
Ranch Hand

Joined: Jun 12, 2003
Posts: 74
I've seen this with the help of javascript.
You can use the onChange attribute of your select tag to call a javascript which submits the form, so that it can be populated by an appropriet action class.
The thing you have to recognize is whether it's the final submit of the whole form, of if it's only a partial submit to fill out some other fields. This can be solved by setting a hidden field to a particular value.
I agree. Here's the link:
subject: Drop down list action
Similar Threads
I want to develop a simple application which is not complex
Two drop-down list that used the same javascript function
Multiple forms - one jsp
Entering a value in a text box by selecting from a floating, hiding drop-down list
Combo Box search as user types