I have a 2 select elements with an id of ticket_customer
and ticket_contact
This JQuery code is on the same page:
$("#ticket_contact").change(function() {
val = $(this).val();
var html = $.ajax({
url: "?getCustomerSequence=1&sequence="+val+"",
async: true,
success: function(data) {
$('#ticket_customer').val(data);
}////////////function html////////
})/////////function ajax//////////
});
so when i change selection, it will run this code:
if($_GET["getCustomerSequence"] == '1') {
echo '1';
exit();
}
which just returns 1
with absolutely nothing else on the page
i want to be able to select the option with the value of 1
(which is returned in the HTML) but its not selecting anything
there is an option in the #ticket_customer
select element with the value of 1
I have tried doing an alert(data);
in the JQuery in the success part which returns 1
too.
alternatively, rather than returning the HTML, would there be a way to return an array in PHP and read this in using JQuery and then getting the correct value from the PHP array using JQuery