• 28-11-2014, 18:57:07
    #1
    Reveloper
    Merhaba,

    <select name="type">
       <option value="1">Dosya</option>
       <option value="2">Yazı</option>
    </select>
    
    <input type="FILE" />
    Eğer 1 seçiliyse type="file"
    Eğer 2 seçiliyse type="text"

    nasıl yapabilirim arkadaşlar örnek kod verebilirmisiniz acaba?
  • 28-11-2014, 19:06:34
    #2
    @Burti;

    <select name="type" id="tip">
       <option>seçiniz</option>
       <option value="1">Dosya</option>
       <option value="2">Yazı</option>
    </select>
    <br>
    <input id="hop" type="text" name="password" />
    <script type="text/javascript">
    	$("#tip").change(function(){
    		if($("#tip").val() == 1){
    			document.getElementById('hop').type = 'file';
    		}else if($("#tip").val() == 2){
    			document.getElementById('hop').type = 'text';
    		}
    	});
    </script>
  • 28-11-2014, 19:28:04
    #3
    Reveloper
    PsdBul adlı üyeden alıntı: mesajı görüntüle
    @Burti;

    <select name="type" id="tip">
       <option>seçiniz</option>
       <option value="1">Dosya</option>
       <option value="2">Yazı</option>
    </select>
    <br>
    <input id="hop" type="text" name="password" />
    <script type="text/javascript">
    	$("#tip").change(function(){
    		if($("#tip").val() == 1){
    			document.getElementById('hop').type = 'file';
    		}else if($("#tip").val() == 2){
    			document.getElementById('hop').type = 'text';
    		}
    	});
    </script>
    eyvallah berkayım saolasın

    --R10.NET; Flood Engellendi -->-> Yeni yazılan mesaj 19:20:48 -->-> Daha önceki mesaj 19:12:37 --

    PsdBul adlı üyeden alıntı: mesajı görüntüle
    @Burti;

    <select name="type" id="tip">
       <option>seçiniz</option>
       <option value="1">Dosya</option>
       <option value="2">Yazı</option>
    </select>
    <br>
    <input id="hop" type="text" name="password" />
    <script type="text/javascript">
    	$("#tip").change(function(){
    		if($("#tip").val() == 1){
    			document.getElementById('hop').type = 'file';
    		}else if($("#tip").val() == 2){
    			document.getElementById('hop').type = 'text';
    		}
    	});
    </script>
    bu calısmıyo ama :/

    http://jsfiddle.net/k3jkmopu/

    --R10.NET; Flood Engellendi -->-> Yeni yazılan mesaj 19:28:04 -->-> Daha önceki mesaj 19:20:48 --

    @PsdBul ama bu çalışmıyor amcaoğlu :/
  • 28-11-2014, 19:34:11
    #4
    Burti adlı üyeden alıntı: mesajı görüntüle
    eyvallah berkayım saolasın

    --R10.NET; Flood Engellendi -->-> Yeni yazılan mesaj 19:20:48 -->-> Daha önceki mesaj 19:12:37 --



    bu calısmıyo ama :/

    http://jsfiddle.net/k3jkmopu/

    --R10.NET; Flood Engellendi -->-> Yeni yazılan mesaj 19:28:04 -->-> Daha önceki mesaj 19:20:48 --

    @PsdBul ama bu çalışmıyor amcaoğlu :/

    val() değil .getAttribute('value') deneyin.
  • 28-11-2014, 19:35:54
    #5
    Reveloper
    Retreat adlı üyeden alıntı: mesajı görüntüle
    val() değil .getAttribute('value') deneyin.
    öylede denedim

    http://jsfiddle.net/k3jkmopu/
  • 28-11-2014, 19:38:19
    #6
    Burti adlı üyeden alıntı: mesajı görüntüle
    eyvallah berkayım saolasın

    --R10.NET; Flood Engellendi -->-> Yeni yazılan mesaj 19:20:48 -->-> Daha önceki mesaj 19:12:37 --



    bu calısmıyo ama :/

    http://jsfiddle.net/k3jkmopu/

    --R10.NET; Flood Engellendi -->-> Yeni yazılan mesaj 19:28:04 -->-> Daha önceki mesaj 19:20:48 --

    @PsdBul ama bu çalışmıyor amcaoğlu :/
    Doğru yere koyarsan olur
  • 28-11-2014, 19:40:28
    #7
    Reveloper
    PsdBul adlı üyeden alıntı: mesajı görüntüle
    Doğru yere koyarsan olur
    koyacam koyacam


    http://www.youtube.com/watch?v=ITWMHcHEI1o
  • 28-11-2014, 20:05:37
    #8
    Burti adlı üyeden alıntı: mesajı görüntüle
    <select name="type" id="tip" onchange="detectType()">
       <option>seçiniz</option>
       <option value="1">Dosya</option>
       <option value="2">Yazı</option>
    </select>
    <input id="hop" type="text" name="password" />
    
    <script>
       function detectType(){
            var thisVal = document.getElementById("tip").value;
            if(thisVal == 1){
                document.getElementById("hop").type = 'file';
            } else if (thisVal == 2){
                document.getElementById("hop").type = 'text';
            }
       }
    </script>