I have the following jQuery that passes variables onto a PHP form:
function getSecondaryCat(val) {
$.ajax({
type: "POST",
url: "category-get-secondary.php",
data:'primary_cat='+val,
success: function(data){
$("#secondary_cat").html(data);
$("#tertiary_cat").html('<option value="">Select specific category</option>')
}
});
}
The above passes the data onto to a PHP function
//Get primary category value
$postPrimaryCat = $_POST['primary_cat'];
Now I want to pass another variable called category_type how do I add it in my jQuery above?
data: { primary_cat: val, category_type: val2 }data:'primary_cat='+val+'&category_type='+type