My chosenstates dropdown gets successfully populated based on the user's selections in states box. This works perfectly. When I submit the home.jsp page I try to display the chosen states in confirm.jsp. None of the states show up. I see the array length as 0.
Is this a right way to store values chosen by user? or is there a more good aproach?
confirm.jsp //returns nothing.
[ March 17, 2007: Message edited by: shah rah ] [ March 17, 2007: Message edited by: shah rah ]
Keep in mind that the only id values that will get submitted are the ones that are actually selected. You have added the items to you second list but nothing will be submitted unless the items are selected. What I have done for this type of page is to add some java script to select all the items in the list of chosen items when the user clicks the submit button.
Joined: Jan 04, 2007
Joined: Feb 15, 2005
Just loop through the options, setting the selected property of each one to true. Example: