This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Struts and the fly likes Struts html:options and JavaScript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts html:options and JavaScript" Watch "Struts html:options and JavaScript" New topic
Author

Struts html:options and JavaScript

Vijay Sarathy
Greenhorn

Joined: Jul 01, 2007
Posts: 2
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

Joined: Jun 16, 2007
Posts: 686

Yes the options will update


===Vyas Sanzgiri===
My Blog
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
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.


Merrill
Consultant, Sima Solutions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts html:options and JavaScript
 
Similar Threads
addrow javascript
My html:select is not working
JSTL inside tag
Forcing struts to validate
Java Script problem