I have the below jquery function
$(function(){
$("select#rooms").change(function(){
$.getJSON("/admin/select.php",{id: $(this).val(), ajax: 'true'},
function(j){
var options = '';
for (var i = 0; i < j.length; i++) {
options += '<option value="' + j[i].optionValue + '">'
+ j[i].optionDisplay + '</option>';
}
$("select#ctlPerson").html(options);
})
})
})
as you see I am passing two values to select.php. The second value is a hardcoded text. Instead of that I would like to send some dynamic value. Can I put a php variable there somehow and pass that?
Basically I am calling a backend script on drop down change and passing its id ..but in some cases I will want to pass another value which is also dependent on drop down change.