Pass more than one select dropdowns value to filter table ( via ajax/php)
Pass more than one select dropdowns value to filter table ( via ajax/php)

Hi there,
I'm following this tutorial but trying to make it work with more than 1 select dropdowns:
I can't work out how to pass 2 select dropdown values via ajax to filter the table
select 1: qualtype
select 2: country
HTML ajax part I'm struggling with:
"ajax":{
type:"POST",
data:{
is_qualtype:is_qualtype,is_country:is_country}
In fetch.php
if(isset($_POST["is_qualtype"]))
{
$query .= " WHERE ";
$query .= "qualification_type = '".$_POST["is_qualtype"]."' ";
}
if(isset($_POST["is_country"]))
{
$query .= " WHERE ";
$query .= "country = '".$_POST["is_country"]."' ";
}
The value is being passed through to fetch.php but it goes to 'is_qualtype' query not 'is_country' query which is incorrect.
Appreciate any help or direction!
Thanks
Greg
This discussion has been closed.
Answers
There is nothing obvious from your code snippets that looks to be a problem. If you want to post a link to your page we can take a look to help debug. Otherwise you can use console.log or the the browser's debugger to follow both
is_qualtype
andis_country
through your code to validate their values. You can use the browser's network inspector to see what values are sent via the ajax request.Kevin
Thanks for this, I worked out I wasn't passing the information using the on selected function.
I'm a lot further on now but have another error unrelated which I will post in another thread.
Thanks