Hi there. I have a HTML page with multiple dynamic check boxes that I select, click "add" and it adds a list to the users on the next page.
This is my JavaScript function that deals with this:
<script language="Javascript">
function doSelect() {
//to avoid "unidentified" results, search elements by tag name
var myLinkCollection = document.getElementsByTagName("input");
var formToSend = document.getElementById("addForm");
//loop through all elements, looking for a checked checkboxes
for ( i = 0; i < myLinkCollection.length; i++ )
{
if( document.getElementsByTagName("input")[i].type == "checkbox" )
{
if ( document.getElementsByTagName("input")[i].checked )
{
document.getElementById("correspondent_id").value = document.getElementsByTagName("input")[i].value;
document.getElementById("action").value = "Select";
document.forms[0].submit();
}
}
}
window.close();
window.opener.window.location.reload();
}
</script>
This works fine in IE.
In firefox, it only submits the first selected checkbox value to the next page, and not the rest.
Please help... I have no idea what I'm doing wrong :(