title: jQuery trigger previously defined onclick from link in new window
body: <p>I am submitting a form using jquery onclick. On the PHP side, it checks to see if there is already an existing document by the same name. If true, a small form is returned in the response with 3 options, dependent on the record data. Those options are displayed in a message window. One of those selections needs to resubmit the previous form data, substituting the new name.</p>
  
  <p>The problem is, the change name form does not exist when the page is loaded and thus does not recognize the ClickCheck class in the new form.</p>
  
  <p>How can I resubmit this form with the new DocName?</p>
  
  <p>The submit in the main form (actually this is one of four submits)</p>
  
  <pre><code>    &lt;a class="ClickCheck" id="Create" href="javascript:void(0)"&gt;Create Bill&lt;/a&gt;
  </code></pre>
  
  <p>The jQuery:</p>
  
  <pre><code>$('.ClickCheck').click(function()
  {
      var ButtonID = $(this).attr('id');
      $('#Clicked').val(ButtonID);
      var Form = $('#TheForm');
      if(ButtonID == "Save")
      {
          // Do save code
      }
      else
      {
          var FormData = Form.serialize();
          $.ajax(
          {
              type: "POST",
              url: "scripts/Ajax.php",
              data: FormData,
              success: function(response)
              {
                  $('#MWContent').html(response);
                  $('#MessageWindow').show();
              }
          });    
      }
  });
  </code></pre>
  
  <p>Then, in the response, I have:</p>
  
  <pre><code>&lt;form id="ChangeName" name="ChangeName"&gt;
    Use another name:
    &lt;input type="text" id="DocName" name="DocName" size="60" maxlength="60" value="" placeholder="Document Name" /&gt;
    &lt;a class="ClickCheck" id="NewName" href="javascript:void(0)"&gt;Go&lt;/a&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>The idea is to have the "NewName" resubmit the form (with the new name, of course.) I can, of course, detect that in the click function.</p>