Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts html:options and JavaScript

 
Vijay Sarathy
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a dropdown which I populate with struts html ptions tag.

i will add new elements to my dropdown through javascript.

My question is whether my new items (which are added by script) would get updated in the arraylist I�m using for html ptions

(This happens fine for text boxes, when JavaScript sets some value in text box and I do a submit and comeback to same page I see the value retained)

thanks in advance
 
Vyas Sanzgiri
Ranch Hand
Posts: 686
Chrome Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes the options will update
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, no, they will not. The list of options is not an input control, and will not be passed to the server when the form is submitted. If you want to update the list of options, you will have to put the options in hidden input fields.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic