|
|
#1 (permalink) |
|
Mesaj: n/a
|
İkinci Combobox'daki Veriyi Çağırma
merhaba arkadaşlar.. benim ilginç bir problemim var. bir formda iki tane combobox kullanıyorum. birinci combobox'tan bir veri seçildiğinde ikinci combobox'da da onunla ilişkili veriler listeleniyor onChange olayı ile.. fakat büyük bir problem var (en azından bana göre öyle) kullanıcı formu post ttikten sonra bir hata olduğunda geriye dönmesi gerektiği durumlarda ikinci combo'daki veriler uçup gidiyor. ben seçilen verinin seçili halde gelmesini istiyorum. sanırım cookie kullanmam lazım JS ile ama nasıl yapacağımı bilmiyorum. yardım ederseniz ve yol gösterirseniz sevinirim. iyi çalışmalar.. |
|
|
|
#3 (permalink) |
|
Üyelik Tarihi: 31.10.2000
Yer: İstanbul
Yaş: 32
Mesaj: 302
|
ikinci combonun verilerini iki boyutlu bir arraya yükle, birinci boyuta kriter datasını ikinci boyuta 2. combonun içeriğini dolduruyoruz. birinci combonun onchange olayında, ikinci komboyu bu arraydandoldurursan problemin çözülür. Daha fazla bilgi/destek istersen bana mail atabilirsin.
__________________
Quis custodiet ipsos custodes? DarkStar - D ve S büyük |
|
|
|
|
|
#4 (permalink) |
|
Üyelik Tarihi: 13.07.2000
Yer: LND
Mesaj: 4,284
|
cookie ile basitçe yapabilirsin,
onchange de options valuesu ile cookie set et. onload' da da cookie varsa optionsı loop edip value yu bulursan selected et.
__________________
FERRUH.MAVİTUNA - İnanmıyorum, yeni site! |
|
|
|
|
|
#6 (permalink) |
|
Mesaj: n/a
|
İşte kodlarim ama..
ii de sevgili arkadaslar back deyince bir kere sayfa yeniden yuklenmiyor ki.. onLoad 'ın işe yaramasi icin bi kere verileri cookie'ye atmam gerekmez mi? bunu nasıl yapacam Js ile bilmiyorum. ASP ile basit ama..
http://www.volan.com.tr/volan/exec/-/tr/2nd_hand/ adresinde bulunan formdaki JS ye eklemem lazim bunu.. Kod:
<script language="JavaScript" type="text/JavaScript"> <!-- var eyle_ = new Array(); eyle_.length=64; eyle_[0-1]=new Array("#","Hepsi"); eyle_[1-1]=new Array("CHEROKEE","GRAND"); eyle_[2-1]=new Array("CHEROKEE","- - - - - - - - - - - - - - - - - -"); eyle_[3-1]=new Array("CHEROKEE","Hepsi"); eyle_[4-1]=new Array("CHEROKEE","- - - - - - - - - - - - - - - - - -"); eyle_[5-1]=new Array("OPEL","CORSA 1.4"); eyle_[6-1]=new Array("OPEL","- - - - - - - - - - - - - - - - - -"); eyle_[7-1]=new Array("OPEL","Hepsi"); eyle_[8-1]=new Array("OPEL","- - - - - - - - - - - - - - - - - -"); eyle_[9-1]=new Array("PONTIAC","LE MANS"); eyle_[10-1]=new Array("PONTIAC","- - - - - - - - - - - - - - - - - -"); eyle_[11-1]=new Array("PONTIAC","Hepsi"); eyle_[12-1]=new Array("PONTIAC","- - - - - - - - - - - - - - - - - -"); eyle_[13-1]=new Array("ROVER","MG"); eyle_[14-1]=new Array("ROVER","- - - - - - - - - - - - - - - - - -"); eyle_[15-1]=new Array("ROVER","Hepsi"); eyle_[16-1]=new Array("ROVER","- - - - - - - - - - - - - - - - - -"); eyle_[17-1]=new Array("TOYOTA","COROLLA 1.6"); eyle_[18-1]=new Array("TOYOTA","- - - - - - - - - - - - - - - - - -"); eyle_[19-1]=new Array("TOYOTA","Hepsi"); eyle_[20-1]=new Array("TOYOTA","- - - - - - - - - - - - - - - - - -"); eyle_[21-1]=new Array("V.WAGEN","PASSAT 1.8"); eyle_[22-1]=new Array("V.WAGEN","POLO"); eyle_[23-1]=new Array("V.WAGEN","- - - - - - - - - - - - - - - - - -"); eyle_[24-1]=new Array("V.WAGEN","Hepsi"); eyle_[25-1]=new Array("V.WAGEN","- - - - - - - - - - - - - - - - - -"); eyle_[26-1]=new Array("VOLVO","440"); eyle_[27-1]=new Array("VOLVO","460"); eyle_[28-1]=new Array("VOLVO","740 GLE"); eyle_[29-1]=new Array("VOLVO","850 GLT"); eyle_[30-1]=new Array("VOLVO","850 SE"); eyle_[31-1]=new Array("VOLVO","850 T5"); eyle_[32-1]=new Array("VOLVO","940 GLE"); eyle_[33-1]=new Array("VOLVO","960"); eyle_[34-1]=new Array("VOLVO","C70 T CAB."); eyle_[35-1]=new Array("VOLVO","C70 T COU."); eyle_[36-1]=new Array("VOLVO","C70 T5 CAB."); eyle_[37-1]=new Array("VOLVO","C70 T5 COU."); eyle_[38-1]=new Array("VOLVO","S 40 1.6"); eyle_[39-1]=new Array("VOLVO","S 40 1.8"); eyle_[40-1]=new Array("VOLVO","S 40 2.0"); eyle_[41-1]=new Array("VOLVO","S 40 2.0 T"); eyle_[42-1]=new Array("VOLVO","S 80 T5"); eyle_[43-1]=new Array("VOLVO","S40"); eyle_[44-1]=new Array("VOLVO","S40 1.6"); eyle_[45-1]=new Array("VOLVO","S40 1.8"); eyle_[46-1]=new Array("VOLVO","S40 2.0"); eyle_[47-1]=new Array("VOLVO","S40 T"); eyle_[48-1]=new Array("VOLVO","S40 T4"); eyle_[49-1]=new Array("VOLVO","S60 T"); eyle_[50-1]=new Array("VOLVO","S60 T5"); eyle_[51-1]=new Array("VOLVO","S70 T"); eyle_[52-1]=new Array("VOLVO","S70 T5"); eyle_[53-1]=new Array("VOLVO","S80 T"); eyle_[54-1]=new Array("VOLVO","S80 T6"); eyle_[55-1]=new Array("VOLVO","V 40 1.8"); eyle_[56-1]=new Array("VOLVO","V 40 2.0 T"); eyle_[57-1]=new Array("VOLVO","V40 1.6"); eyle_[58-1]=new Array("VOLVO","V40 2.0"); eyle_[59-1]=new Array("VOLVO","V40 T4"); eyle_[60-1]=new Array("VOLVO","V70 T"); eyle_[61-1]=new Array("VOLVO","XC 90"); eyle_[62-1]=new Array("VOLVO","- - - - - - - - - - - - - - - - - -"); eyle_[63-1]=new Array("VOLVO","Hepsi"); eyle_[64-1]=new Array("VOLVO","- - - - - - - - - - - - - - - - - -"); function ModelKonumla(model){ var gelenveri = document.forms['arac_islem_formu'].me_Arac_ModelID; for(var i=0; i<gelenveri.options.length; i++){ if(gelenveri.options[i].value == model){ gelenveri.options[i].selected = true; } } } // ModelKonumla.. function SecilenStrGetir(gelenveri){ var gelenveriText = ""; for(var i=0; i<gelenveri.options.length; i++){ if(gelenveri.options[i].selected && gelenveri.options[i].value != ""){ gelenveriText = gelenveri.options[i].text; } } return gelenveriText; } // SecilenStrGetir.. function ModelleriYaz(marka_){ document.forms['arac_islem_formu'].me_Arac_ModelID.length=0; var cnt = 0; var isSelected = false; for(var i=0; i<64; i++){ if (eyle_[i][0]==marka_){ yeni_secenek=new Option; yeni_secenek.value=eyle_[i][1]; yeni_secenek.text=eyle_[i][1]; if (!isSelected){ yeni_secenek.selected = true; isSelected = true; } document.forms['arac_islem_formu'].me_Arac_ModelID.options[cnt]=yeni_secenek; cnt=cnt+1; } } } // ModelleriYaz.. function Gercekle(gelenveri){ var marka_ = SecilenStrGetir(gelenveri); ModelleriYaz(marka_); //document.forms['arac_islem_formu'].me_Arac_ModelID.options[0].selected = true; } // Gercekle.. //--> </script> <form method="get" action="exec.ASP" name="arac_islem_formu"> <select name="me_Arac_MarkaID" onchange="Gercekle(this);" class="UrunKutu3"> <option value="#">Hepsi</option> <option value="#">- - - - - - - - - - - - - - - - - -</option> <option value="AMERİCAN MOTORS">AMERİCAN MOTORS</option> <option value="BMW">BMW</option> <option value="BUGATTİ">BUGATTİ</option> <option value="BUİCK">BUİCK</option> <option value="CADİLLAC">CADİLLAC</option> <option value="CHEROKEE">CHEROKEE</option> <option value="CHEVROLET">CHEVROLET</option> <option value="CHRYSLER">CHRYSLER</option> <option value="CİTROEN">CİTROEN</option> <option value="CORVAİR">CORVAİR</option> <option value="DAEWOO">DAEWOO</option> <option value="DAİHATSU">DAİHATSU</option> <option value="DAİMLER">DAİMLER</option> <option value="DATSUN">DATSUN</option> <option value="DE TOMASO">DE TOMASO</option> <option value="DESOTO">DESOTO</option> <option value="DODGE">DODGE</option> <option value="FERRARİ">FERRARİ</option> <option value="FİAT">FİAT</option> <option value="FORD">FORD</option> <option value="GENERAL MOTORS">GENERAL MOTORS</option> <option value="OPEL">OPEL</option> <option value="PONTIAC">PONTIAC</option> <option value="ROVER">ROVER</option> <option value="TOYOTA">TOYOTA</option> <option value="V.WAGEN">V.WAGEN</option> <option value="VOLVO">VOLVO</option> <option value="#">- - - - - - - - - - - - - - - - - -</option> <option value="Hepsi">Hepsi</option> <option value="#">- - - - - - - - - - - - - - - - - -</option> </select> <select name="me_Arac_ModelID" class="UrunKutu3"> <option value="#">Hepsi</option> <option value="#">- - - - - - - - - - - - - - - - - -</option> <option value="#">Hepsi</option> <option value="#">- - - - - - - - - - - - - - - - - -</option> </select> </form> |
|
|
|
#7 (permalink) |
|
Üyelik Tarihi: 09.12.2000
Yer: istanbul
Yaş: 30
Mesaj: 1,973
|
eğer form post edişlmişse zaten veriler
<% for k=1 to Request.form("combo1").Count response.write Request.form("combo1")(k) & "<br>" next %> şeklinde tutulmuştur, hata durumunda back yapmak yerine bir hata sayfasında bu şekilde görüntüleyebilirsin...
__________________
"oturduğum mahallenin yolları çamurluydu, boyalı ayakkabı giysem bile, o yollardan geçtikten sonra çamurlanmamaları mümkün değildi. hayatım da böyle." yılmaz güney http://www.sipidik.com |
|
|
|
Zoque'a hoşgeldiniz!