merhaba arkadaşlar
pazar günü bile böyle şeylerle uğraşmak beni çok sıkıyor ama mecburuz işte

neyse şimdi alttaki kodda da anlayacağınız üzere alt kategorinin değişmesi halinde fiyat tipi de tetiklenerek değişiyor. Fiyat tipinin değişmesi halinde de fiyat değişiyor.
Kod:
<td width="23%" height="30" class="formdataTD" style="padding-left:15px;">
<select name="alt_kategori_id" id="alt_kategori_id" onChange="alt_kategori_degisti(this.value);" >
<option value="">--Alt Kategoriyi Seçiniz--</option>
</select>
</td>
<td width="21%" height="10" class="formdataTD" style="padding-left:15px;">
<select name="fiyat_tipi_id" id="fiyat_tipi_id" onChange="fiyat_tipi_degisti(this.value);">
<option value="">--Fiyat Tipini Seçiniz--</option>
</select>
</td>
Benim yapmak istediğim alt kategori değiştiği zaman id sinin fiyat_xml.php dosyasına gönderebilmek.
Kod:
<script language="javascript">
function alt_kategori_degisti(Id)
{
xmlhttp = false;
if (window.XMLHttpRequest) { // Mozilla, Safari,...
xmlhttp = new XMLHttpRequest();
if (xmlhttp.overrideMimeType) {
xmlhttp.overrideMimeType('text/xml');
}
} else if (window.ActiveXObject) { // IE
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {}
}
}
var url="xml/fiyat_tipi_xml.php?Id="+Id;
xmlhttp.open("POST", url, true);
xmlhttp.onreadystatechange = function () {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
xmlDoc=xmlhttp.responseXML;
var sonuc = xmlDoc.documentElement;
var kayit_kontrol=sonuc.childNodes[0].childNodes[0].firstChild.nodeValue;
document.getElementById('fiyat_tipi_id').options.length=0;
document.getElementById('fiyat_tipi_id').options[0]=new Option (' -- Fiyat Tipi Seçiniz -- ','');
if(kayit_kontrol>0)
{
var gkod2=sonuc.childNodes[0].childNodes[1];
for (i=0;i<gkod2.childNodes.length;i++){
document.getElementById('fiyat_tipi_id').options[0].selected=new Option (' -- Fiyat Tipi Seçiniz -- ','');
document.getElementById('fiyat_tipi_id').options[i+1]=new Option(gkod2.childNodes[i].firstChild.nodeValue,gkod2.childNodes[i].firstChild.nodeValue);
}
}
}
}
xmlhttp.send(null);
}
</script>
<script language="javascript">
function fiyat_tipi_degisti(Id)
{
xmlhttp = false;
if (window.XMLHttpRequest) { // Mozilla, Safari,...
xmlhttp = new XMLHttpRequest();
if (xmlhttp.overrideMimeType) {
xmlhttp.overrideMimeType('text/xml');
}
} else if (window.ActiveXObject) { // IE
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {}
}
}
var url="xml/fiyat_xml.php?Id="+Id;
alert(url);
xmlhttp.open("POST", url, true);
xmlhttp.onreadystatechange = function () {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
xmlDoc=xmlhttp.responseXML;
var sonuc = xmlDoc.documentElement;
var kayit_kontrol=sonuc.childNodes[0].childNodes[0].firstChild.nodeValue;
document.getElementById('fiyati').options.length=0;
document.getElementById('fiyati').options[0]=new Option (' -- Fiyatı Seçiniz -- ','');
if(kayit_kontrol>0)
{
var gkod2=sonuc.childNodes[0].childNodes[1];
for (i=0;i<gkod2.childNodes.length;i++){
document.getElementById('fiyati').options[0].selected=new Option (' -- Fiyatı Seçiniz -- ','');
document.getElementById('fiyati').options[i+1]=new Option(gkod2.childNodes[i].firstChild.nodeValue,gkod2.childNodes[i].firstChild.nodeValue);
}
}
}
}
xmlhttp.send(null);
}
</script>
Bunu nasıl yapabiliriz? Bilgisi olup da paylaşan arkadaşlara teşekkürler.