The thing is i don't know how to send the options to the servlet (or retrieve the options like getParameter("OrderList")),
i need all the option's text parameters (best to return with values also but not necessarily).
I have read a little about JSON, still not sure if i really need it to accomplish this task.
any ideas or suggestions ?
You have not made what you are trying to accomplish clear. And the fact that options are dynamically generated is a red herring. The state of the <select> element at submission time is all that matters. It makes no difference how it got to that state.
With that in mind, care to restate your requirements?
By default, a <select> element will have the value of the selected option (which defaults to its content if no value is provided) passed using the name assigned to the select. What is it that you want that is different from this?
I need the names and the values of the SELECT.
in my servlet the line:
so i thought maybe it's because initially the select was empty, therefore asking if there is
a different way to get those names and values.
so in my servlet i could get a List or other object that will contain:
there can be one selected option but i need them all.
Nope, you will not be able to get the text content (they're not names, so stop calling them that, it's just confusing) of the options using the select element in any configuration -- the text content of the options is not ever part of the submission. If the values are omitted, the values will default from the text content, but that only works if they're to be the same which is not the case here.
If you want all the options returned, including text content and values, you'll need to create hidden inputs containing the information you want.
You could do this in a submit handler established on the form.