1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
$('#serie').on('change', function() {
var val = $(this).val(); // Get the serial number
if(val != '') {
$('#op').empty(); // Clear all Serial# form the option list
$('#op').append('<option value="" selected disabled hidden>-- OP --</option>');
$.ajax({
// Request existing Serial# for the current machine
url: 'json_generator/reference_op_list.php',
data: {
'machine' : $('#selmac').val(),
'reference' : val,
'op_list' : 'go'
},
dataType: 'json',
success: function(json) {
$.each(json, function(index, value) {
$('#op').append('<option value="'+ value +'">'+ value[0] +'</option>');
});
}
});
}
})
$('#number').on('change', function(){
var val = $(this).val();
//if(val != "--Number--") {
$.ajax({
url: 'json_generator/reference_op_list.php',
data: {
'machine' : '3',
'part_list': 'go'
},
dataType: 'json',
success: function(json) {
$('#serial').append('<option >Success</option>');
}
});
//}
}) |
Partager