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   ;
}
}

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.