brad0525
asked on
passing multiple values using xmlhttp.send
I am using the script below to pass values from a form to a php page. The first xmlhttp.send always returns a value, the second one is always blank. I am trying to figure out how to send multiple values using xmlhttp.send
if(xmlhttp) {
var txtname = document.getElementById("txtname");
var number = document.getElementById("number");
xmlhttp.open("POST","testing.php",true); //calling testing.php using POST method
xmlhttp.onreadystatechange = handleServerResponse;
xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xmlhttp.send("txtname=" + txtname.value); //Posting txtname to PHP File
xmlhttp.send("number=" + number.value); //Posting number to PHP File
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Have you tried something like this:
xmlHttp.send("txtname=txtn ame.value& number=num ber.value" );
xmlHttp.send("txtname=txtn
You're welcome! Thanks for the points!
ASKER