Re: And I need to know how can i update a drop-down field based on a selection made in another drop down field
Posted By:
Antti_Ropponen
Posted On:
Thursday, September 8, 2005 07:18 AM
I have the same problem in a way. I have three drop dows and the second is populated according to the first and the third according to the second. The thing work fine with javascript but the problem is that I need to localize those values (in English, French, German, Finnish, Sweden) and I'd like to use struts, is it possible? Anyone could show me some solutions or tips?
Sorry for my uncorrect English.
Re: And I need to know how can i update a drop-down field based on a selection made in another drop down field
Posted By:
Anonymous
Posted On:
Saturday, July 2, 2005 07:40 AM
Just Right Click and View Sorce on the following links:
http://securecmm.com/minisites/secureparking/reg_prefs.asp
OR
http://www.bestwebatlanta.com/resources/javascripts/dropdown_box_population_smart.htm
Thanks,
Ravish Malhotra.
ravishm@safaltek.com
+919872071911
Re: And I need to know how can i update a drop-down field based on a selection made in another drop down field
Posted By:
Dennis_McKnight
Posted On:
Thursday, June 16, 2005 03:00 PM
i had to do something like this once. the easiest way would be to have the form submit and refresh once a city is selected, but if you are trying to avoid that you can use what i did.
what you can do is create an ArrayList which holds all the cityCd;street elements... like so
PHL;Walnut
PHL;Chestnut
PHL;Spruce
PHX;Prospect
PHX;Main
....
and so on, where the code before the ';' is the city code used in your dropdown and the text after the ';' is the street name. insert all combinations into your ArrayList and forward it in the request to your jsp.
in the jsp i write a javascript function & array based on those values. here is some sample code ( you need to pass your 2 form objects to it).
not the cleanest way to do it, but it works without refreshing the page. hopefully this code is enough to get you started.... good luck.
Re: And I need to know how can i update a drop-down field based on a selection made in another drop down field
Posted By:
suc_Jag
Posted On:
Thursday, June 16, 2005 02:24 PM
hi
i have almost similar requirement.. once user selects one item from the selection box ...i have to populate related data in the textboxes below it... i did that as follows
In the action form there is selection box and below text boxes which need to be populated according to the selection
In the selection box there is one property "onchange"..
set this propetry to call an action class.. in that action class you can take the selected value and query database using that value..
Then set the other fields of the action form with the resultset data.... for this to achieve the action form should be is session scope.
I hope it will work.for you.. if you need futher clarification..let me know i will give elaborated description
good luck