54 lines
1.0 KiB
JavaScript
54 lines
1.0 KiB
JavaScript
$(function(){
|
|
$("#categoria").on("change",function(e){
|
|
var questo = $(this);
|
|
var zero = 0;
|
|
|
|
$.ajax({
|
|
url: "cercaprod.php",
|
|
data: { 'categoria': questo.val()},
|
|
dataType: "json",
|
|
success: function(r) {
|
|
if (r.status=="OK"){
|
|
$("#produttore").html(r.prod);
|
|
$("#materiale").html(r.mat);
|
|
$("#vendita").val(zero.value);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
$("#produttore").on("change",function(e){
|
|
var questo = $(this);
|
|
var cat = document.getElementById("categoria");
|
|
var zero = 0;
|
|
|
|
$.ajax({
|
|
url: "cercaart.php",
|
|
data: { 'produttore': questo.val(), 'categoria': cat.value},
|
|
dataType: "json",
|
|
success: function(r) {
|
|
if (r.status=="OK"){
|
|
$("#materiale").html(r.mat);
|
|
$("#vendita").val(zero.value);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
$("#materiale").on("change",function(e){
|
|
var questo = $(this);
|
|
|
|
$.ajax({
|
|
url: "cercamat.php",
|
|
data: { 'articolo': questo.val()},
|
|
dataType: "json",
|
|
success: function(r) {
|
|
if (r.status=="OK"){
|
|
$("#vendita").val(r.art);
|
|
$("#taglia").html(r.tag);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|