• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

select: on change action and retaining values

 
shailesh kumar
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I have two combo boxes combo1 and combo2, Combo1 is populated with list of values from database. Upon selecting value in combo1 iam calling javascrpit function which submits form and populates combo2. The problem is since the form is submitted the combo1's selected value is not retained ?, how can I retain the selected value by the user??
Also how can I call two diffrent actions on change diffrent combo boxes ??, any help is appreciated..
I tried this Javascript but this doen't work..


Here is my actual code

 
Arulanand Dayalan
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its simple. On submitting the form based on the values selected in combo1, retreive values for combo2. Then set it the request. For combo1, set both the selected and unselected values again in the request before forwarding it to the view.
 
shailesh kumar
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply, but how can I call two diffrent actions, when I select values from combo1 I want to call action1 and on combo2 action2 ??
This javasctipt doesn't work and I looked at the LookupDispatchAction class in struts..but that logic will work with buttons only.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic