hi all, real js noob here and I'm sure this has been asked, I'm just not able to find a solution that works for me. I have been trying to find a way to collect all the values of a set of check boxes on a page I have and submit them to an ajax function to be processed in php. The problem is that I can not get the functions I have to pass anything other than an empty value.

the functions I'm using to try and get these values read as below and work for all other elements on the form.

Code:
<script type="text/javascript">

var req;
var doesNotSupport = true; 
 
function putData(url, id, col, data, elementid) 
{ 
    if (!doesNotSupport) 
        return; 
 
    if (window.XMLHttpRequest) { 
        req = new XMLHttpRequest; 
    } else if (window.ActiveXObject) { 
        req = new ActiveXObject("Microsoft.XMLHTTP"); 
    } 
     
    if (col == 'requests') {
    	data = checkboxValues('requests[]');
    }
    
    if (req) { 
       req.onreadystatechange = processReqChange(elementid); 
       req.open("POST", url + '?id=' + id + '&col=' + col +'&value=' + data, true); 
       req.send(null); 
    } else { 
       alert("Your browser does not support XMLHttpRequest technology!"); 
       doesNotSupport = false; 
    } 
}

function checkboxValues(name){
    var nodes = document.getElementsByName(name);
    var n;
    var values = new Array();
    for (var i = 0; n = nodes[i]; i++) {
        if (n.checked == true) {
            values[n]=n.value;
        }
    }
    return values;
}


function processReqChange(elementid) {
    // only if req shows "loaded"
    if (req.readyState == 4) { 
        // only if "OK"
        if (req.status == 200) { 
        	var returnData = req.responseText;
            document.getElementById(elementid).value = returnData;
            document.getElementById(elementid).title = returnData;
        } else { 
            alert("There was a problem retrieving the data:\n" + req.statusText);
            document.getElementById(elementid).value = req.statusText;
        } 
    } 
}

</script>
the check box array is displayed like this and is created on the fly by php
HTML Code:
<table>
<tbody><tr><th colspan="3">Requests</th>
</tr><tr><td valign="top">
		<ul>
	<li>
	<label><input name="requests[]" id="requests[]" value="6" onchange="putData('ajax/incidentReport.ajax.php', 'LLIR94080248', 'requests', '', this.id);" type="checkbox"> Ambulance</label>	</li>
		<li>
	<label><input name="requests[]" id="requests[]" value="2" onchange="putData('ajax/incidentReport.ajax.php', 'LLIR94080248', 'requests', '', this.id);" type="checkbox"> Backboard</label>	</li>

		<li>
	<label><input name="requests[]" id="requests[]" value="8" onchange="putData('ajax/incidentReport.ajax.php', 'LLIR94080248', 'requests', '', this.id);" type="checkbox"> Fire</label>	</li>
		<li>
	<label><input name="requests[]" id="requests[]" value="3" onchange="putData('ajax/incidentReport.ajax.php', 'LLIR94080248', 'requests', '', this.id);" type="checkbox"> Helicopter</label>	</li>
	</ul></td><td valign="top" width="33%"><ul>	<li>

	<label><input name="requests[]" id="requests[]" value="5" onchange="putData('ajax/incidentReport.ajax.php', 'LLIR94080248', 'requests', '', this.id);" type="checkbox"> Lift Evacuation</label>	</li>
		<li>
	<label><input name="requests[]" id="requests[]" value="10" onchange="putData('ajax/incidentReport.ajax.php', 'LLIR94080248', 'requests', '', this.id);" type="checkbox"> Off Site SNR</label>	</li>
		<li>
	<label><input name="requests[]" id="requests[]" value="11" onchange="putData('ajax/incidentReport.ajax.php', 'LLIR94080248', 'requests', '', this.id);" type="checkbox"> Oxygen</label>	</li>

		<li>
	<label><input name="requests[]" id="requests[]" value="7" onchange="putData('ajax/incidentReport.ajax.php', 'LLIR94080248', 'requests', '', this.id);" type="checkbox"> Police</label>	</li>
	</ul></td><td valign="top" width="33%"><ul>	<li>
	<label><input name="requests[]" id="requests[]" value="1" onchange="putData('ajax/incidentReport.ajax.php', 'LLIR94080248', 'requests', '', this.id);" type="checkbox"> Regular Sled</label>	</li>
		<li>

	<label><input name="requests[]" id="requests[]" value="9" onchange="putData('ajax/incidentReport.ajax.php', 'LLIR94080248', 'requests', '', this.id);" type="checkbox"> Ski Do</label>	</li>
		<li>
	<label><input name="requests[]" id="requests[]" value="4" onchange="putData('ajax/incidentReport.ajax.php', 'LLIR94080248', 'requests', '', this.id);" type="checkbox"> Truma Pack</label>	</li>
	</ul></td></tr></tbody></table>

Can anyone spot the error or know of a better way for me to get this array. In the end I need to be able to serialize the array in php any post it to the DB.

Thanks.