title: Selecting a form which is in an iframe using jQuery
body: <p>I have a form inside an iframe which is inside a jQuery UI dialog box.  The form contains a file input type.  The jQuery UI dialog contains an Upload button.  When this button is clicked, I would like to programmatically call the submit method.  My question is how I could select the form which is in a iframe using jQuery.  The following code should clarify the picture:</p>
  
  <pre><code>&lt;div id="upload_file_picker_dlg" title="Upload file"&gt;        
      &lt;iframe id="upload_file_iframe" src="/frame_src_url" frameborder=0 width=100% scrolling=no&gt;&lt;/iframe&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>frame_src_url contains:</p>
  
  <pre><code>&lt;form action="/UploadTaxTable" enctype="multipart/form-data" method="post" id="upload-form"&gt;            
  &lt;p&gt;Select a file to be uploaded:&lt;/p&gt;
  &lt;p&gt;
      &lt;input type="file" name="datafile" size="60"&gt;
  &lt;/p&gt;
  </code></pre>
  
  <p></p>
  
  <p>The jQueryUI dialog box javascript code:</p>
  
  <pre><code>$('#upload_file_picker_dlg').dialog({
      ...
      buttons: {
          'Close': function() { 
              $(this).dialog('close'); 
          },
          'Upload': function() {              
              $('#upload-form').submit(); //question is related to this line
              $(this).dialog('close'); 
          }
      },
      ....
  });
  </code></pre>
  
  <p>From the javascript code snippet above, how can I select the form with id <strong>upload-form</strong> that is in the iframe whose id is <strong>upload_file_iframe</strong> ?</p>