File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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!
jQuery in Action, 2nd edition
subject: Field Refresh Using AJAX in Struts2
Similar Threads
how to populate dropdown box dynamically
Dependent Drop- Down
JSF drop down.
dropdown & javascript
how to populate drop down list using servlet and jsp