Suppose that selected the one value in drop down list, then after selection of value in drop down list same drop down list regenerated again in same JSP Page(as a previous drop down list).
How is to possible? How to do it?
Suppose that selected the one value in drop down list, then after selection of value in drop down list same drop down list regenerated again in same JSP Page(as a previous drop down list).
How is to possible? How to do it?
Hard way of doing it http://jsfiddle.net/daWd9/
Suppose consider that your source dropdown list id is 'list1'. By using document.getElementById('list1') you'll get the details of that element. Then use document.createElement to create a new dropdown list and get the properties from the existing one document.getElementById('list1').
I suppose, you have to select multiple values from same options. I would have done it using jQuery UI. Please follow the link for demo http://jqueryui.com/demos/autocomplete/#multiple .
Open the link.
Start typing in textbox, options will auto-populate.
You can select one and again start typing.
It will be a good user-friendly solution, in my opinion.
Hope it helps.
There two solutions documented in StackOverflow using AJAX technology
How to call AJAX request on dropdown change event?
How to call AJAX request on dropdown change event?
Please see the above will help you.
By the way I don't understand why you need to
regenerate again in same JSP Page(as a previous drop down list).