2 Replies Latest reply on Nov 10, 2016 11:59 AM by almore.cato

    How to push multiple config data

    almore.cato

      Hi,

       

      I'm running into some problems when getting form config data - the way my tile config view is set up you can have multiple fieldsets for each slide in the slider. In my attempt to retrieve it, it keeps coming back as undefined

       

      Here's the config view setup.

      <body>
          <div class="j-card">
              <form id="inputContainer">
                  <fieldset class="slideInputs">
                      <input type="text" placeholder="Enter Slide Image Src">
                      <input type="text" placeholder="Enter Slide Headline">
                      <input type="text" placeholder="Enter Slide Directing Link">
                      <button class="remove" onclick="removeSlide(this)">-</button>
                  </fieldset>
              </form>
              <button class="addSlides" onClick="addSlide()">Add New Slide</button>
              <button class="j-btn" id="btn_submit">Submit</button>
          </div>
      </body>
      

      here's a piece of the config logic where i'm just testing to see if i can retrieve all form objects to start, but it comes back as undefined.

       

          function getForms() {
              var elem = document.forms["inputContainer"];
              console.log(elem);
          }
         
          $("#btn_submit").click(function () {
              getForms();
              //tileConfig["data"]["configString"] = $("").val();
              jive.tile.close(tileConfig, {});
          });
          app.resize();
      } // end function
      

       

       

      Could you guys give any suggestions on the best way for me to retrieve this data?

      Scott A Johnson

      Ryan Rutan

      Gopi Gorantala

        • Re: How to push multiple config data

          Not sure why your document.forms["inputContainer"] comes back as empty, this returns the HTML object when I load the script after the HTML renders (since I'm not using button click).

          <body>  
              <div class="j-card">  
                  <form id="inputContainer">  
                      <fieldset class="slideInputs">  
                          <input type="text" placeholder="Enter Slide Image Src">  
                          <input type="text" placeholder="Enter Slide Headline">  
                          <input type="text" placeholder="Enter Slide Directing Link">  
                          <button class="remove" onclick="removeSlide(this)">-</button>  
                      </fieldset>  
                  </form>  
                  <button class="addSlides" onClick="addSlide()">Add New Slide</button>  
                  <button class="j-btn" id="btn_submit">Submit</button>  
              </div> 
          </body>
          
          
          
          
          <script>
                  var elem = document.forms["inputContainer"];
          console.log(elem);
          </script>
          

           

          Your saved config data will come in through the jive.tile.onOpen listener

          jive.tile.onOpen((config,options) =>{
               console.log(config);
          })