karthik80c
asked on
How to pass ajax request from an array collection Js
Hi Experts,
This is my html
This is my html
<input type ='checkbox' data-param=1553066000000681004>
. when check box is checked i need to get the attribute value and pass it to ajax request . but in my page i have multiple check box like this and i get the value . but i cant pass this as ajax request bcoz its a array and i go for each function in jquery but it wont work . Please Take a look at my code$boxes = $('input[type=checkbox]:checked');
if ($boxes.length == 1) {
$id = $(this).attr("data-param");
//do something
}else{
$boxes.each(function () {
$newid=[];
$newid=$(this).attr("data-param")+' ; ' ;
});
$.post("contacts.aspx?id="+newid,
function(data, status){
alert(data);
});
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Using JSON.stringify(ArrayVariab
After receiving the JSON values in the target page using PHP built in function "json_decode($string, true);" you can parse it.
Note: it suites for all the technology...