• 30-06-2013, 21:16:05
    #1
    Merhabalar,
    1 tane textfield var buraya yazılan değeri yanındaki linke ekletmek istiyorum sizce nasıl yapabilirim?
  • 01-07-2013, 01:48:50
    #2
    <script>
    $(function(){
    $('input[name="verilen name degeri gelecek").keyup(function(){
    var val = $(this).val();
    $('.deger').attr('href',val);
    });
    });
    </script>
    <a href="#" class="deger">Değer</a>
  • 01-07-2013, 13:10:03
    #3
    denedim çalışmadı.
    Kod blogum alttaki gibi:

    <input type="text" id="fiyat" name="fiyat" onchange="hesapla()" />
    <a class="popup" href="dovizhesapla.php?fiyat=textfielddeyazilan"><img src="images/dovizhesapla.png" /></a>
  • 01-07-2013, 17:21:47
    #5
    ellerinize sağlık güzel olmuş ama text fielde 1 kere tıklamadan tutarı linke yazdırmıyor.
    textfielde değer başka bir javascript dosyası ile geliyor.

    oda şu şekilde

    <script type="text/javascript">
    
    function carp()
    {
    var sum=0;
    var x=0;
    var y=0;
    var parabirimi = 0;
    
    x=$("#oda :selected").attr("rel");
    
    sum =  x;
    document.getElementById('fiyat').value = sum;
    }
    
    function hesapla() {
        var getEl = function(id){
                return document.getElementById(id)
            },
            setDate = function(val) {
                var vP = val.split('.');
                return new Date(vP[2], vP[1]-1, vP[0])        
            };
        var gunlukFiyat = parseInt(getEl('fiyat').value,10),
            giristarihi = setDate(getEl('giristarihi').value),
            cikistarihi = setDate(getEl('cikistarihi').value),
            ucret = getEl('ucret');
        var birGun=1000*60*60*24;
            
    	    gunsayisii = Math.round((cikistarihi-giristarihi)/(birGun));
       
       ucret.value = gunsayisii*gunlukFiyat;
    	gunsayisi.value = Math.round((cikistarihi-giristarihi)/(birGun));
    
    }
    
    </script>
  • 01-07-2013, 20:14:42
    #6
    <input name="fiyat" />
    <a onclick="dovizhesapla()" > Hesapla </a>
    <script>
    function dovizhesapla(){
    var url    = 'dovizhesapla.php?fiyat=';
    $(function(){
    var fiyat = $('input[name="fiyat"]').val();
    
    	window.location.href = url+fiyat;
           return true;
    
    });
    }
    </script>
    ayrıca neden böyle bişey yapmıyosunuz onuda merak ettim
    <form action="dovizhesapla.php" method="GET">
    <input name="fiyat" /><br/>
    <button>Hesapla </button>
    </form>
  • 02-07-2013, 09:37:49
    #7
    başka bir form koymamım sebebi bir form içinde olmasından dolayı.
    Evet en son verdiğiniz örnek güzel oldu ellerinize sağlık.

    popup class ile çalıştırmaya çalıştırdıgımda hata veriyor.

    popup classım head tagı içiersinde

    <script type="text/javascript">
    function doPopups() {
    
      if (!document.getElementsByTagName) return false;
    
      var links=document.getElementsByTagName("a");
    
      for (var i=0; i < links.length; i++) {
    
        if (links[i].className.match("popup")) {
    
          links[i].onclick=function() {
    
            // Below - to open a full-sized window, just use: window.open(this.href);
    
            window.open(this.href, "", "top=10,left=10,width=1024,height=768,scrollbars");
    
            return false;
    
          }
    
        }
    
      }
    
    }
    
    window.onload=doPopups;
    
    
    </script>
  • 03-07-2013, 15:19:38
    #8
    onclick="dovizhesapla('genislik','yükseklik');" popup şeklinde kullanabilirsin
    <a onclick="dovizhesapla('1500','600');" href="#"> Hesapla </a>
    <script>
    
    function dovizhesapla(width,height){
    var url    = 'dovizhesapla.php?fiyat=';
    $(function(){
    var fiyat = $('input[name="fiyat"]').val();
    return window.open(url+fiyat,'','width='+width+',height='+height);
    
    
    });
    }
    
    </script>
  • 04-07-2013, 13:12:00
    #9
    ellerinize sağlık.