aspose file tools*
The moose likes Spring and the fly likes Adding form:option dynamically Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Adding form:option dynamically" Watch "Adding form:option dynamically" New topic
Author

Adding form:option dynamically

venkatesh pendharkar
Ranch Hand

Joined: Apr 29, 2006
Posts: 106
I am using 2 <form:select> tags on my jsp page, one for list of countries & other for list of states in that country. What I am doing is, once a country is selected, then through dwr I am calling my controller & getting back list of state objects. Each state object is populated with name & code of state. Now I want to add the state list names & code to the <form:select> related to state. I could not find any way to add this dynamically. Can anyone give me any suggestions or hints?

I have tried to use dwr API as follows:-
for(var i =0; i<data.length;i++){
dwr.util.addOptions(selectbox, [data[i].name]);
}
But this will add ><option> tag & not <formption> tag.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Adding form:option dynamically
 
Similar Threads
Populate MultiSelect Dojo box onLoad from XML data file
Dynamic AJAX control
problem while loading the welcome page
Calling a controller method without reloading whole page
Spring form tag library