• 21-11-2023, 21:25:18
    #1
    Dosyam :
    <!DOCTYPE html>
    <html lang="en">
    <head>
      <meta charset="UTF-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <title>Configuration Page</title>
      <script src="https://code.jquery.com/jquery-3.6.4.min.js"></script>
      <script src="jquery.repeater.min.js"></script>
    </head>
    <body>
      <form class="repeater">
        <div data-repeater-list="configuration">
          <div data-repeater-item>
            <label>Tipi</label>
            <select>
              <option>Select</option>
    <option>İnput</option>
    </select>
            <div class="inner-repeater" data-repeater-list="option">
              <div data-repeater-item>
                <label>Opsiyon</label>
                <input type="text">
              </div>
              <button type="button" data-repeater-create>Opsiyonu Çoğaltan Buton</button>
            </div>
    
          </div>
        </div>
        <button type="button" data-repeater-create>Yapılandırmayı Çoğaltan Buton</button>
     <button type="submit">Gönder</button>
      </form>
    
      <script>
        $(function () {
          'use strict';
          $('.repeater').repeater({
            show: function () {
              $(this).slideDown();
            },
            hide: function (deleteElement) {
              if (confirm('Are you sure you want to delete this element?')) {
                $(this).slideUp(deleteElement);
              }
            }
          });
        });
    
      </script>
    </body>
    </html>
    Yapmak istediğim şey ürünlerde özel yapılandırma ajax ile php dosyama şu formu göndermek istiyorum
    print_r($_POST] dediğimde böyle bir sonuç almak istiyorum
    {{"configuration_title":"başlığı","configuration_t ype":"select","configuration_price":"50"},{"config uration_title":"başlık 2","configuration_type":"input","configuration_pri ce":"20"}}

    Bu sonucu nasıl elde edebilirim javascript ile
  • 21-11-2023, 21:42:29
    #2
    hocam keşke profil fotomuzu çalmasaydınız
  • 21-11-2023, 21:50:55
    #3
    electroshoc adlı üyeden alıntı: mesajı görüntüle
    hocam keşke profil fotomuzu çalmasaydınız
    Googleden almıştım hocam pp yi
  • 21-11-2023, 21:51:29
    #4
    Webiay adlı üyeden alıntı: mesajı görüntüle
    Googleden almıştım hocam pp yi
    iyi LOTR Fanı tek ben değilim o zaman
  • 03-12-2023, 17:36:08
    #5
    Webiay adlı üyeden alıntı: mesajı görüntüle
    Dosyam :
    <!DOCTYPE html>
    <html lang="en">
    <head>
      <meta charset="UTF-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <title>Configuration Page</title>
      <script src="https://code.jquery.com/jquery-3.6.4.min.js"></script>
      <script src="jquery.repeater.min.js"></script>
    </head>
    <body>
      <form class="repeater">
        <div data-repeater-list="configuration">
          <div data-repeater-item>
            <label>Tipi</label>
            <select>
              <option>Select</option>
    <option>İnput</option>
    </select>
            <div class="inner-repeater" data-repeater-list="option">
              <div data-repeater-item>
                <label>Opsiyon</label>
                <input type="text">
              </div>
              <button type="button" data-repeater-create>Opsiyonu Çoğaltan Buton</button>
            </div>
    
          </div>
        </div>
        <button type="button" data-repeater-create>Yapılandırmayı Çoğaltan Buton</button>
     <button type="submit">Gönder</button>
      </form>
    
      <script>
        $(function () {
          'use strict';
          $('.repeater').repeater({
            show: function () {
              $(this).slideDown();
            },
            hide: function (deleteElement) {
              if (confirm('Are you sure you want to delete this element?')) {
                $(this).slideUp(deleteElement);
              }
            }
          });
        });
    
      </script>
    </body>
    </html>
    Yapmak istediğim şey ürünlerde özel yapılandırma ajax ile php dosyama şu formu göndermek istiyorum
    print_r($_POST] dediğimde böyle bir sonuç almak istiyorum
    {{"configuration_title":"başlığı","configuration_t ype":"select","configuration_price":"50"},{"config uration_title":"başlık 2","configuration_type":"input","configuration_pri ce":"20"}}

    Bu sonucu nasıl elde edebilirim javascript ile

    php'nin, json_encode fonksiyonunu incelemelisiniz.

    https://www.php.net/manual/en/function.json-encode.php