View Full Version : ajax post problem

10-30-2008, 10:30 PM
When it comes to the POST I don't know how to pass the parameters:

function sendDelCheck(){
var url = "delCheck.php";
/*these are supposed to be the paramters
var params = "tableName="+document.getElementsByName('tableName').value+"&submit="+document.getElementById('deleteButton').value;
http.open("POST", url, true);

//Send the proper header information along with the request
http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http.setRequestHeader("Content-length", params.length);
http.setRequestHeader("Connection", "close");

http.onreadystatechange = function() {//Call a function when the state changes.
if(http.readyState == 4 && http.status == 200) {

11-01-2008, 01:45 PM
i believe you are having a problem with serializing your data before sending it :
document.getElementsByName('tableName').value, this gives you a collection but doesnt give ajax the access to each variable value. maybe you should try something like:document.getElementsByName('tableName')[0].value....[1].value...etc

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum