$(document).
ready(
function() {
$(
'select[name="reference_code"]').
on(
'change',
function() {
var no_po = $(this).
val();
var result = no_po.
split(
'/');
var iki = result[
1];
if(iki) {
$.
ajax({
url:
'{{ url("contract/get_no_po") }}/'+iki,
type:
"GET",
dataType:
"json",
success:
function(data) {
$(
'select[name="select_company"]').
empty();
$.
each(data,
function(key,value) {
$(
'select[name="select_company"]').
append(
'<option value="'+ key +
'">'+ value +
'</option>');
});
}
});
}
else{
$(
'select[name="select_company"]').
empty();
}
});
});