Jump to content

Sending Array Of Values To Ajax From Multiselect Dropdown


naveendk.55

Recommended Posts

I am trying to send multiple values to ajax variable(value) from multiple dropdown list. However, this is not working. I want multiple values to be stored in ajax variable if I select more than one dropdown value. Any help plz?

 

 

Below is the ajax code:

 

var xmlHttp1;
var xmlHttp1;
var str = new Array();
//xmlHttp.setRequestHeader( "Content-Type", "application/json" );
function showState1(str){

if (typeof XMLHttpRequest != "undefined"){
xmlHttp1= new XMLHttpRequest();
}
else if (window.ActiveXObject){
xmlHttp1= new ActiveXObject("Microsoft.XMLHTTP");
}
if (xmlHttp1==null){
alert("Browser does not support XMLHTTP Request");
return;
}
var url="test.jsp";
url +="?value=" +str;

xmlHttp1 .onreadystatechange = stateChange1;
xmlHttp1.open("POST", url, false);
xmlHttp1.send(null);
}
function stateChange1(){  
if (xmlHttp1.readyState==4 || xmlHttp1.readyState=="complete"){  
document.getElementById("functUnit").innerHTML=xmlHttp1.responseText   ;
}
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.