Aggiunta associazione

This commit is contained in:
2019-04-29 16:51:42 +02:00
parent 391a850339
commit 6d18fd19ae
33 changed files with 2987 additions and 1 deletions

View File

@@ -0,0 +1,53 @@
$(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);
}
}
});
});
});