title: How can i stack multiple array in localStorage javascript?
body: <p>I'm having a problem in my app where i will store the data in the localStorage everytime the client enter a case. here's my html using modal.</p>
  
  <pre><code>           &lt;div class="modal-body"&gt;
                  &lt;div class="form-group"&gt;
                      &lt;input class="form-control date-picker" placeholder="Month and Year" id="c_round" name="c_round"&gt;
                  &lt;/div&gt;
                  &lt;div class="form-group"&gt;
                      &lt;select class="form-control" id="prov" name="prov"&gt;
                          &lt;option&gt;Select Province&lt;/option&gt;
                          &lt;option value="01"&gt;Province1&lt;/option&gt;
                          &lt;option value="02"&gt;Province2&lt;/option&gt;
                          &lt;option value="03"&gt;Province3&lt;/option&gt;
                      &lt;/select&gt;
                  &lt;/div&gt;
                  &lt;div class="form-group"&gt;
                      &lt;select class="form-control" id="mun" name="mun"&gt;
                          &lt;option&gt;Select Municipality&lt;/option&gt;
                          &lt;option value="01"&gt;Municipality1&lt;/option&gt;
                          &lt;option value="02"&gt;Municipality2&lt;/option&gt;
                          &lt;option value="03"&gt;Municipality3&lt;/option&gt;
                      &lt;/select&gt;
                  &lt;/div&gt;
                  &lt;div class="form-group"&gt;
                      &lt;select class="form-control" id="brgy" name="brgy"&gt;
                          &lt;option&gt;Select Barangay&lt;/option&gt;
                          &lt;option value="001"&gt;Barangay1&lt;/option&gt;
                          &lt;option value=:002&gt;Barangay2&lt;/option&gt;
                          &lt;option value="003"&gt;Barangay3&lt;/option&gt;
                      &lt;/select&gt;
                  &lt;/div&gt;
                  &lt;div class="form-group"&gt;
                      &lt;label for="commodity" class="control-label text-left"&gt;Household Classification&lt;/label&gt;
                      &lt;div class="form-horizontal"&gt;
                          &lt;input type="radio" name="h_classification" value="Farming"&gt; Farming &amp;emsp;&amp;emsp;
                          &lt;input type="radio" name="h_classification" value="Non-Farming"&gt; Non-Farming
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/div&gt;&lt;!--End modal body--&gt;
              &lt;div class="modal-footer"&gt;
                  &lt;button type="submit" id="create" class="btn btn-primary pull-right" data-dismiss="modal" &gt;Create&lt;/button&gt;
              &lt;/div&gt;
  </code></pre>
  
  <p>When the client click the Create button the data will store in the localStorage here's my jquery.</p>
  
  <pre><code>$(function() {
  
  var round = $("#c_round");
  var prov  = $("#prov");
  var mun   = $("#mun");
  var brgy  = $("#brgy");
  var h_classification = $("[name='h_classification']");
  var btn_create = $('#create');
  var dataObject = [];
  
  btn_create.on('click', function(){ 
      if(typeof(Storage) !== "undefined"){
          dataObj = [{
              'user_id': user_id,
              'prov'   : prov.val(),
              'mun'    : mun.val(),
              'brgy'   : brgy.val(),
              'r_code' : r_code,
              'h_class': h_classification.val()
          }];
  
          dataObject.push(dataObj);
  
          localStorage.setItem('dataObject', JSON.stringify(dataObject));
  
          retrivedOjects = localStorage.getItem('dataObject');
  
          console.log('retrivedOjects: ', JSON.parse(retrivedOjects));
      }else {
          alert("Error: Localstorage not supported");
      }
  });
  
  });
  </code></pre>
  
  <p>When i refresh the page the old data is still there but when i create new data the old data is replaced by new data it doesn't append.</p>
  
  <p>I want to stack many arrays in the localStorage("dataObjects") first before sending it on to the server for my offline mode application, </p>
  
  <p>(sorry for my english)</p>