Go Back   CodingForums.com > :: Client side development > JavaScript programming > Ajax and Design

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-30-2008, 10:30 PM   PM User | #1
gilgalbiblewhee
Regular Coder

 
Join Date: Mar 2005
Posts: 735
Thanks: 4
Thanked 1 Time in 1 Post
gilgalbiblewhee is an unknown quantity at this point
ajax post problem

When it comes to the POST I don't know how to pass the parameters:
Code:
function sendDelCheck(){		
	var url = "delCheck.php";
	/*these are supposed to be the paramters
	tableName=game1
	&CheckAll=Check+All
	&selectVerse0=game1_1
	&tableName=game2
	&tableName=game3
	&tableName=game4
	&tableName=game5
	&submit=Delete
	*/
	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) {
			alert(http.responseText);
		}
	}
	http.send(params);
}
__________________
Compare bible texts (and other tools):
TheWheelofGod
gilgalbiblewhee is offline   Reply With Quote
Old 11-01-2008, 01:45 PM   PM User | #2
sybil6
Regular Coder

 
Join Date: Jul 2006
Posts: 399
Thanks: 33
Thanked 7 Times in 7 Posts
sybil6 can only hope to improve
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

Last edited by sybil6; 11-01-2008 at 09:27 PM..
sybil6 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:00 AM.


Advertisement
Log in to turn off these ads.