title: jquery/JavaScript - Delay until upload complete
body: <p>My jQuery script looks something like (the form is submitting files to upload):             </p>
  
  <pre><code>      $("#addMore").click(function() {
                  $("#progForm").submit();
                  $("#upTar").css("display","block");
                  $("#title").val("");$("#obj").val("");$("#theory").val("");     $("#code").val("");$("#output").val("");$("#conc").val("");
              });
  </code></pre>
  
  <p>I want to delay the execution of the code beginning from $("#upTar") until the form submission is completed (that is the files are uploaded and PHP script has responded).</p>
  
  <p><strong>Edit</strong></p>
  
  <p>#upTar is an iframe and the target of the form submission. I want #upTar to be displayed only after its content has been generated from the form action script.</p>
  
  <p>Thanks!</p>
  
  <p><strong>Code after solution</strong>        </p>
  
  <pre><code> $("#addMore").click(function() {
      $("#progForm").submit();
      $('#upTar').load(function() {
          $("#upTar").css("display","block");
          $("#title, #obj, #theory, #code, #output,     #conc").val("");
         });
   });
  </code></pre>