Hi people - it's been a while since I asked a question on here, but the time has come again! I would like to have a jsp page with a form consisting of several inputs and selects. When page loads for the first time, there is only one select (with values taken from database), but after clicking on link "add", the subsequent selects are added (using JavaScript and DOM). It seems to be pretty easy task, but I'm not sure how to populate the newly created select with data. Any help it greatly appreciated Sam
Well, where do you get your data from when you add your new select? If it's the same as the old select you can stitch an id on the first form you create within your java page and then loop through it's elements and add them to the newly created select(this should be done when adding the newly element, and after checking it was rendered in DOM). That is the best I can do for the information you gave.
you can do it easly with jquery, just google this: jquery dynamic select (as I did lol) you will find something useful (server side examples are in php anyway I'm sure you can easly convert into java jsp)