This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Struts and the fly likes calling another .do call on changing the value from Dropdown Box Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "calling another .do call on changing the value from Dropdown Box" Watch "calling another .do call on changing the value from Dropdown Box" New topic
Author

calling another .do call on changing the value from Dropdown Box

andrew ronchi
Ranch Hand

Joined: Nov 03, 2011
Posts: 48

i have a dropdown box in my struts application. onchange,i want to call another .do call with id of that selected value...?how cn i do that...
Alberto Dousdebes
Greenhorn

Joined: Sep 02, 2008
Posts: 22
Hi!

You can call a JavaScript function in "onChange" event. This function retrieves the selected value and call any action you want:



And the javaScript function



Havent tested but it's an idea.

bye!
john lazeraski
Ranch Hand

Joined: Nov 14, 2011
Posts: 76
Are you using a library like jQuery or Prototype? If so, you can set a click handler to call a JS function, which in turn makes an ajax request to the .do action.
andrew ronchi
Ranch Hand

Joined: Nov 03, 2011
Posts: 48

thanks a lot guys....it worked...
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: calling another .do call on changing the value from Dropdown Box