my problem is with the selected index property of a dynamic list that is populated from a servlet.
Let's say a list A is populated from a servlet. The inner HTML comes from the servlet as responseText and is used in the callBack function of ajax:
Here's the script:
s = xmlHttpRequest.responseText;
var drop = '<select name="' + dynaDiv + '" id="' + dynaDiv + '">' + s + '</select>';
document.getElementById(dynaDiv).innerHTML = drop;
where s comes from the servlet as:
Now if I want to create another list dynamically, let's say B, based on the selection in A, how do I retrieve the selected index of A in a script? I tried but it gives null. The aim is to generate a link of such lists. Moreover, I thought that since the list has been populated as a string(responseText rather than responseXML) the problem lies here. But if I change it to responseXML, how do return values from the servlet? (Given that I need one set for value and one for text)