Hi,
I have a struts form with two selects. The idea is to have a some elements in one and add or remove the selected element to the other with the “>” and the “<” buttons. Is a classic assignation problem.
I’ve been trying to do this with javascript. I found a script that works for this that recieves the select objects. So, I have to pass these objects to the function.
If I use document.getElementsByName(‘name’); it finds the object, but when I try to get the selected elements with:
for (var i = 0; i < CONTROL.length; i++) {
if (CONTROL.options[i].selected == true)
I get an error saying that CONTROL.options has no properties.
The script I have originally used document getElementById(‘id’), but since struts’ tags don’t support the id attribute I had to change it to document.getElementsByName(‘name’);
Does anyone know what to do here?
I didn’t know whether to post this in this forum or in the web development one, but since it has to do with struts I posted here. Sorry if it belongs to the other one.
Thanks.
Pablo