• 08-09-2013, 14:07:10
    #1
    Merhabalar;

    Bootstrap form helper elemanlarını jquery içinde load methodu ile kullanamıyorum. Ajax ile değilde düz sayfada sorun yok. Sebebi konusunda yardımcı olabilecek olan varmı.

    index.php

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Deneme</title>
    <link href="inc/bootstrap/css/bootstrap.min.css" media="screen" rel="stylesheet" type="text/css" />
    <script src="inc/jquery/jquery-1.10.1.min.js"></script>
    <script src="inc/bootstrap/js/bootstrap.js"></script>
    <script type="text/javascript" src="inc/bootstrap/js/bootstrap-formhelpers-phone.format.js"></script>
    <script type="text/javascript" src="inc/bootstrap/js/bootstrap-formhelpers-phone.js"></script>
    
    </head>
    
    <body>
        <script type="text/javascript"> 
            $(document).ready(function(){
            $('#testdiv').load('examples.php');
    
            });
        </script>
    
        <div id="testdiv"></div>
    </html>

    examples.php

    <form id="kayit" class="form-horizontal">
    <div class="control-group">
                <label class="control-label">Cep Telefonu</label>
                <div class="controls">
                    <div class="input-prepend">
                    <span class="add-on"><i class="icon-th-list"></i></span>
                        <input type="text" class="input-xlarge bfh-phone" name="CepTelefonu" data-format="+dd (ddd) ddd-dddd-dd">
                    </div>
                </div>
            </div>
          </form>
  • 13-09-2013, 14:57:56
    #2
    1. examples.php ile index.php nin aynı klasörde olduğudan emin ol.
    2. Bootstrap js dosyaları sayfanın sonuna eklenir. O yüzden bootstrap js dosyalarnı body i kapatmadan önce ekle
    3. bootstrap js dosyalarının içinde jquery nin 1.10 daki sürümünde depricated olan fonksiyonlar var ise load işlemini yapmayacaktır.

    Şuan için aklıma gelenler bunlar..
  • 23-09-2013, 16:00:59
    #3
    $('#testdiv').load('examples.php',function(){
    $('form input[type="text"].bfh-phone, form input[type="tel"].bfh-phone, span.bfh-phone').each(function () {
    var $phone = $(this);

    $phone.bfhphone($phone.data());
    })
    });
  • 26-09-2013, 01:11:59
    #4
    Teşekkürler işe yaradı

    mystec adlı üyeden alıntı: mesajı görüntüle
    $('#testdiv').load('examples.php',function(){
    $('form input[type="text"].bfh-phone, form input[type="tel"].bfh-phone, span.bfh-phone').each(function () {
    var $phone = $(this);

    $phone.bfhphone($phone.data());
    })
    });