This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Struts and the fly likes Field Refresh Using AJAX in Struts2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Field Refresh Using AJAX in Struts2" Watch "Field Refresh Using AJAX in Struts2" New topic

Field Refresh Using AJAX in Struts2

Abdul Mujeeb Md

Joined: Aug 25, 2008
Posts: 26

How do we populate a text field with the value from database, when a dropdown value is selected.

eg: OnChange of a dropdown an AJAX event is to be triggered and populate the adjacent textfield with the value from the database.

Sean Clark

Joined: Jul 15, 2009
Posts: 377


You chave just given yourself the answer.
You cheate an onchange event that will send an ajax request and then populate some DIV (or an input box in this case) with the response.

Do you have any code to look at or a specific question?


I love this place!
I agree. Here's the link:
subject: Field Refresh Using AJAX in Struts2
Similar Threads
dropdown & javascript
how to populate dropdown box dynamically
how to populate drop down list using servlet and jsp
Dependent Drop- Down
JSF drop down.