title: jquery date picker in clone year and month not working and default date was not showing
body: <p>Currently working on clone and datepicker using jquery. With my current code cloning was happening perfectly. In the clone div the datepicker was working but it was not working like original. </p>
  
  <ol>
  <li><p>When the user click add more button it was cloning entire div perfectly with the dates but if i select the date textfield from the cloned div <strong>year and month dropdown not displaying.</strong></p></li>
  <li><p>When the user click add more button in the original Degree date it was showing the current date but in the clone it was not showing.</p></li>
  </ol>
  
  <p>I have tried with all possibilites from my side I am not getting </p>
  
  <p>I have tried added destroy for the datepicker still not working</p>
  
  <p>Here is my jquery code</p>
  
  <pre><code>var i = 1;
      $(document).on("click", ".edu_add_button", function() {
      var i = $('.cloned-row1').length;
      $(".cloned-row1:last").clone(true).insertAfter(".cloned-row1:last").attr({
              'id': function(_, id) {
                      return id + i
              },
              'name': function(_, name) {
                      return name + i
              }
      }).end().find('[id]').val('').attr({
              'id': function(_, id) {
                      return id + i
              }
      });
      $(".cloned-row1:last").find(".school_Name").attr('disabled', true).val('');
      $(".cloned-row1:last").find(".degree_Description").attr('disabled', true).val('');
      $(".cloned-row1:last").find('.datepicker,.datepicker1').removeClass('hasDatepicker').datepicker();
  
      i++;
  
      return false;
    });
  
    $("#txt_Degdat").datepicker({
            dateFormat: "mm-dd-yy",
            changeMonth: true,
            changeYear: true,
            yearRange: '1900:2100'
    }).on('change', function() {
            if ($('#txt_Degdat').valid()) {
                    $('#txt_Degdat').removeClass('errRed');
            }
            // triggers the validation test on change
    }).datepicker("setDate", "0");
    $("#txt_Trsdat").datepicker({
            dateFormat: "mm-dd-yy",
            changeMonth: true,
            changeYear: true,
            yearRange: '1900:2100'
    }).on('change', function() {
            if ($('#txt_Trsdat').valid()) {
                    $('#txt_Trsdat').removeClass('errRed');
            }
            // triggers the validation test on change
    });
  
  
  
    $(document).on('click', ".btn_less1", function() {
            var len = $('.cloned-row1').length;
            if (len &gt; 1) {
                    $(this).closest(".btn_less1").parent().parent().parent().remove();
            }
    });
  </code></pre>
  
  <p>Here is the HTML code</p>
  
  <pre><code>&lt;div class="container-fluid cloned-row1"&gt;
  &lt;div class="row"&gt;
      &lt;div class="col-xs-6 col-sm-3 col-md-4 col-lg-3"&gt;
          &lt;label&gt;School Name&lt;/label&gt;
          &lt;br/&gt;
          &lt;select class="slt_Field txt_schName" name="txt_schName[]"&gt;
              &lt;option value=""&gt;Please Select&lt;/option&gt;
              &lt;option value="Emirates College of Technology- UAE"&gt;COL000001&lt;/option&gt;
              &lt;option value="Al Khawarizmi International College- UAE"&gt;COL000002&lt;/option&gt;
              &lt;option value="Syscoms College"&gt;COL000003&lt;/option&gt;
              &lt;option value="Abounajm Khanj Pre-Uni Center"&gt;COL000004&lt;/option&gt;
              &lt;option value="Advanced Placement"&gt;COL000005&lt;/option&gt;
              &lt;option value="Al Buraimi College (Uni Clge)"&gt;COL000006&lt;/option&gt;
              &lt;option value="Al-Ain Community College"&gt;COL000007&lt;/option&gt;
              &lt;option value="AMA Computer College"&gt;COL000008&lt;/option&gt;
              &lt;option value="Arab Academy for Bankg and Fin"&gt;COL000009&lt;/option&gt;
              &lt;option value="ARABACDSCITECHMARTIMETRNS"&gt;COL000010&lt;/option&gt;
              &lt;option value="Arapahoe Community College"&gt;COL000011&lt;/option&gt;
          &lt;/select&gt;
      &lt;/div&gt;
      &lt;div class="col-xs-6 col-sm-3 col-md-4 col-lg-3"&gt;
          &lt;br&gt;
          &lt;input type="text" class="ipt_Field school_Name" name="school_Name[]" disabled/&gt;
      &lt;/div&gt;
      &lt;div class="col-xs-6 col-sm-3 col-md-4 col-lg-3"&gt;
          &lt;label&gt;&lt;span class="text-error"&gt;*&lt;/span&gt;High School Avg / CGPA&lt;/label&gt;
          &lt;br/&gt;
          &lt;input type="text" class="ipt_Field ipt_Havg" id="" name="ipt_Havg[]" /&gt;
      &lt;/div&gt;
      &lt;div class="col-xs-6 col-sm-3 col-md-4 col-lg-3"&gt;
          &lt;label&gt;&lt;span class="text-error"&gt;*&lt;/span&gt;Grade Type @&lt;/label&gt;
          &lt;br/&gt;
          &lt;select class="slt_Field ipt_grd" name="ipt_grd[]"&gt;
              &lt;option value=""&gt;Please Select&lt;/option&gt;
              &lt;option value="n"&gt;100&lt;/option&gt;
              &lt;option value="n1"&gt;4&lt;/option&gt;
              &lt;option value="c"&gt;CHAR&lt;/option&gt;
          &lt;/select&gt;
      &lt;/div&gt;
      &lt;input type="text" placeholder="MM/DD/YYYY" class="ipt_Field txt_Degdat" name="txt_Fdob" /&gt;
  &lt;/div&gt;
  &lt;button class="btn_less1 btn_right "&gt;Less&lt;/button&gt;
  &lt;button class="btn_more btn_right edu_add_button"&gt;Add More&lt;/button&gt;
  </code></pre>
  
  <p></p>
  
  <p>Here is the weave <a href="http://liveweave.com/gGuGQy" rel="nofollow">Link</a></p>
  
  <p>Any suggestion please what I am doing wrong here.</p>
  
  <p>I have tried all possibilities nothing was working any idea please</p>