title: Create form with replaceWith() function in Jquery, But unable to validate using jquery validation Plugin
body: <p>I have created html page and it has empty division tag, using jquery i can replace form in empty div tag. these steps are working properly. but when try validate form which was created previously using replaceWith()function, not supported at all. i used jquery validation plugin for validation process, codes are below.</p>
  
  <p>Jquery replace function</p>
  
  <pre><code>$(document).ready(function () {
      $("#add_new_parent").click(function () {
          $("#family_page_body").replaceWith("&lt;form name='add-parent' id='add-parent' action='#' method='post'&gt;
  &lt;div class='row'&gt;
  &lt;div class='col-md-4'&gt; &lt;label for='nic'&gt;NIC Number :&lt;/label&gt;
   &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class='row'&gt;
  &lt;div class='col-md-4'&gt;
  &lt;input type='text' name='txt_nic' style='height: 35px;' class='form-control' id='txt_nic' autocomplete='off' placeholder='Enter your NIC Number'&gt;
  &lt;/div&gt;&lt;/div&gt;&lt;/form&gt;");
  });
  });
  </code></pre>
  
  <p>Jquery Validation Codes</p>
  
  <pre><code>jQuery.validator.addMethod("nic_validator", function (value, element) {
      return this.optional(element) || /^[V-V0-9]+$/.test(value);
  }, "Invalid NIC Number");
  $(document).ready(function () {
      $("#add-parent").validate({
          submitHandler: function (form) {
           var form_data = $("#add-parent").serialize(); 
              $(form).ajaxSubmit({
                  url: "../svr/add-parent.php",
                  data: form_data,
                  dataType: "json",
                  success: function (data) {
                      $("#error").html(data);                   
                  }                
              });
          },
          rules: {
              txt_nic:{
                  required:true,
              },
              office_contact:{
                  maxlength:3,
              },
              messages: {
                 txt_nic: {
                     required:"This Field Is Required",
                  }
              }
          }
      });
  });
  </code></pre>
  
  <p>This is a Html Page</p>
  
  <pre><code>&lt;div class="middle-box"&gt;
                      &lt;br/&gt;
                      &lt;div id="family_page_body"&gt;
  
                          &lt;br/&gt;
                      &lt;/div&gt;
  
                  &lt;/div&gt;
  </code></pre>