If got two related selects that are working perfectally using:
$("#fac_name").change(function() {
var id=$(this).val();
var dataString = 'id='+ id;
$.ajax
({
type: "POST",
url: "qry/ajax_proceedures.php",
data: dataString,
cache: false,
success: function(html) {
$("#proceedure_type").html(html);
}
});
});
$('#fac_name').trigger('change');
});
However, in some instances, the first dropdown #fac_name won’t be present on the page.
Instead there will be a hidden field with the same name - #proceedure_type - in the place of the dropdown.
My problem is - I need to get the 2nd dropdown to load from whatever value comes up in the hidden field when the page loads. I’m just not sure how to to get it to do that.
Suggestions please