jQuery(function($) {
$(document).ready(function() {
$(".marka").change(function(){
$tr = $($(this).parent()).parent(); // select the parent <tr> element
$marka = ($tr.children()).children("select.marka"); // looking for the child class #marka
$sechenie = ($tr.children()).children("select.sechenie"); // looking for the child class #sechenie
$kolichestvo = ($tr.children()).children(".kolichestvo"); // looking for the child class #kolichestvo
$cena2_ = ($tr.children()).children(".cena2_"); // looking for the child class #cena
$summa = ($tr.children()).children(".summa"); // looking for the child class #summa
$ed_izmer2_ = ($tr.children()).children(".ed_izmer2_"); // looking for the child class #ed_izmer
GetSechenie($marka.val(),$sechenie);
GetCena($marka.val(),$cena2_,$sechenie.val());
GetEd_Izmer($marka.val(),$ed_izmer2_,$sechenie.val());
setTimeout(function() { CalcTr($tr); }, 500);
});
});
});
function GetEd_Izmer(marka,ed_izmer2_,sechenie) {
jQuery(function($){
$.post( "get.php",
{ type: "text",
marka: marka,
sechenie: sechenie,
vid: "izm",
},
function(data){
$ed_izmer2_.attr('value', data);
}
);
});
}
function GetCena(marka,cena2_,sechenie) {
jQuery(function($){
$.post( "get.php",
{ type: "text",
marka: marka,
sechenie: sechenie,
vid: "cena2_",
},
function(data){
$cena2_.attr('value', data);
}
);
});
}
function GetSechenie(marka,sechenie) {
jQuery(function($){
$.post( "get.php",
{ type: "text",
marka: marka,
vid: "sechenie",
},
function(data){
$sechenie.children('option').remove();
$sechenie.append(data);
}
);
});
}
|