0

I am a beginner in struts, here my Question is dynamically add value into dropdown list when i check radio button. Already two values were present in dropdown list. if i click radio button two more values should add. i am using struts-html tag inside JSP page. Please give idea or suggest how to do this ?

Thanks in advance.

Jonas
  • 121,568
  • 97
  • 310
  • 388
siva
  • 165
  • 1
  • 4
  • 11

1 Answers1

0

One quick ad dirty way to do this would be messing with DOM events and javascript to change options in your select. This would add a third option to your select :

document.<formId>.<selectId>.options[2]=new Option("Label", "value", false, false)

For this to work, you'll have to retreive DOM ids for your tags (assuming worst case, i.e. struts 1)

Preuk
  • 632
  • 7
  • 18
  • There is no id attribute for struts HTML (form & select) tag. I got syntax expression error. – siva Jul 05 '12 at 10:35