• 28-07-2010, 23:33:34
    #1
    merhaba arkadaslar

    elimde bir adet form var ve bu formda 2 adet listbox ve 1 adet textbox var.

    listboxdaki ve textboxdaki veriler mysql den cekiliyor.

    listboxda secili olan optionu degistirdigimde textboxdaki degerinde degismesini istiyorum(mysqlden cekilerek).

    ajax bilmiyorum ajax disinda baska bi yontemle yapilabilir mi bu ?

    cevaplayan arkadaslara simdiden tesekkur ederim.
  • 28-07-2010, 23:38:13
    #2
    jump menü ile yapabilirsin
  • 28-07-2010, 23:58:16
    #3
    Kimlik doğrulama veya yönetimden onay bekliyor.
    Örnek bir kod yazdım sana anlamazsan biraz daha detaylı açıklayabilirim.


    <?
     echo "
    <form method=post name=kullaniciduzenle" action=>
    <tr>
        <td>Yetki</td>
        <td>:</td>
        <td><select onchange=\"kontrol()\" name=\"yetki\" id=\"yetki\">
    <option value=\"okur\" >Okur</option>
    <option value=\"yazar\" >Caylak</option>
    <option value=\"yazar\" >Yazar</option>
    <option value=\"mod\" >Moderator</option>
          <option value=\"admin\" >Admin</option>";
        echo "</select></td>
      </tr>
      <tr>
        <td>Durum</td>
        <td>:</td>
        <td><select name=\"durum\" onchange=\"kontrol()\" id=\"durum\">
     <option value=\"aktif\" >Aktif</option>
    <option value=\"aktifdegil\" >Aktif_Degil</option>
    <option value=\"sus\" >Banli</option>
    </select></td>
      </tr>
    </form>
    ";
    ?>
    <script type="text/javascript">
    kontrol();
    function kontrol(){
    	var x;
    	if(document.kullaniciduzenle.yetki.selectedIndex==0 || document.kullaniciduzenle.yetki.selectedIndex==1){
    		document.kullaniciduzenle.durum.selectedIndex=1;
    		document.kullaniciduzenle.durum.options[0].disabled = true;
    		document.kullaniciduzenle.durum.options[2].disabled = true;
    	}
    	else{
    		document.kullaniciduzenle.durum.options[0].disabled = false;
    		document.kullaniciduzenle.durum.options[1].disabled = false;
    		document.kullaniciduzenle.durum.options[2].disabled = false;
    	}
    	if((document.kullaniciduzenle.yetki.selectedIndex==2 || document.kullaniciduzenle.yetki.selectedIndex==3 || document.kullaniciduzenle.yetki.selectedIndex==4 || document.kullaniciduzenle.yetki.selectedIndex==5 ) && document.kullaniciduzenle.durum.selectedIndex!=2){
    		document.kullaniciduzenle.durum.selectedIndex=0;
    		document.kullaniciduzenle.durum.options[1].disabled = true;
    		x=1;
    			}
    	
    	else if(document.kullaniciduzenle.durum.selectedIndex==2){
    		document.kullaniciduzenle.yetki.selectedIndex=0;
    		document.kullaniciduzenle.yetki.disabled=true;
    	}
    	else{
    	document.kullaniciduzenle.yetki.disabled=false;	
    	document.kullaniciduzenle.durum.options[1].disabled = false;
    	}
    
    	
    }
    </script>
  • 29-07-2010, 13:05:17
    #4
    Twinsens adlı üyeden alıntı: mesajı görüntüle
    Örnek bir kod yazdım sana anlamazsan biraz daha detaylı açıklayabilirim.


    <?
     echo "
    <form method=post name=kullaniciduzenle" action=>
    <tr>
        <td>Yetki</td>
        <td>:</td>
        <td><select onchange=\"kontrol()\" name=\"yetki\" id=\"yetki\">
    <option value=\"okur\" >Okur</option>
    <option value=\"yazar\" >Caylak</option>
    <option value=\"yazar\" >Yazar</option>
    <option value=\"mod\" >Moderator</option>
          <option value=\"admin\" >Admin</option>";
        echo "</select></td>
      </tr>
      <tr>
        <td>Durum</td>
        <td>:</td>
        <td><select name=\"durum\" onchange=\"kontrol()\" id=\"durum\">
     <option value=\"aktif\" >Aktif</option>
    <option value=\"aktifdegil\" >Aktif_Degil</option>
    <option value=\"sus\" >Banli</option>
    </select></td>
      </tr>
    </form>
    ";
    ?>
    <script type="text/javascript">
    kontrol();
    function kontrol(){
    	var x;
    	if(document.kullaniciduzenle.yetki.selectedIndex==0 || document.kullaniciduzenle.yetki.selectedIndex==1){
    		document.kullaniciduzenle.durum.selectedIndex=1;
    		document.kullaniciduzenle.durum.options[0].disabled = true;
    		document.kullaniciduzenle.durum.options[2].disabled = true;
    	}
    	else{
    		document.kullaniciduzenle.durum.options[0].disabled = false;
    		document.kullaniciduzenle.durum.options[1].disabled = false;
    		document.kullaniciduzenle.durum.options[2].disabled = false;
    	}
    	if((document.kullaniciduzenle.yetki.selectedIndex==2 || document.kullaniciduzenle.yetki.selectedIndex==3 || document.kullaniciduzenle.yetki.selectedIndex==4 || document.kullaniciduzenle.yetki.selectedIndex==5 ) && document.kullaniciduzenle.durum.selectedIndex!=2){
    		document.kullaniciduzenle.durum.selectedIndex=0;
    		document.kullaniciduzenle.durum.options[1].disabled = true;
    		x=1;
    			}
    	
    	else if(document.kullaniciduzenle.durum.selectedIndex==2){
    		document.kullaniciduzenle.yetki.selectedIndex=0;
    		document.kullaniciduzenle.yetki.disabled=true;
    	}
    	else{
    	document.kullaniciduzenle.yetki.disabled=false;	
    	document.kullaniciduzenle.durum.options[1].disabled = false;
    	}
    
    	
    }
    </script>
    hocam anlattığım mantık guzel tesekkur ederim.textbox a gore duzenlersek 3 tane texbox basip sirasiyla gosterecegiz.