These are the two arrays which are sent from ajax call to php
var mycol=new Array();
var mycolval=new Array();
var inputs = document.getElementsByTagName("input");
for (var i = 1; i < inputs.length; i++)
{
if($("#"+inputs[i].id).val().length>0)
{
flag=true;
mycol=inputs[i].id;
mycolval=$("#"+inputs[i].id).val();
}
}
And this is the string
var string = $('#search_input').val();
I have tried the following code but it doesn't seem to work. Please help me come up with solution.
$.ajax({
url: "anding.php",
type: "POST",
dataType: 'json',
data: JSON.stringify(mycol:mycol,mycolval:mycolval,string:string),
success: function(response){}
});