managed_file form element doesn't render correctly <p>I have a simple managed file form element that is the only element in my form. It looks like this:</p> <pre><code>$form['upload'] = array( '#type' =&gt; 'managed_file', '#title' =&gt; t('Select a YML file'), '#progress_message' =&gt; t('Please wait...'), '#progress_indicator' =&gt; 'bar', '#description' =&gt; t('Click "Browse..." to select a file to upload.'), '#required' =&gt; TRUE, '#upload_validators' =&gt; array('file_validate_extensions' =&gt; array('yml txt docx')), '#upload_location' =&gt; $upload_dest, ); </code></pre> <p>When I render the form using the drupal_get_form callback in hook_menu I get a perfectly formed managed_file upload field with the browse and upload buttons. Things change when I decide I want to add a table of information underneath the form. This requires building a table using theme functions then adding that to the form by rendering the form and appending the table. I create my table and add it to the form:</p> <pre><code>$rows = array(); foreach($yml_files as $yml_file){ $rows[] = array($yml_file-&gt;uri, $yml_file-&gt;filename); } $output = drupal_render($form['upload']); $output .= theme('table', array('header'=&gt;$header, 'rows'=&gt;$rows)); return $output; </code></pre> <p>When I generate the form using drupal_render, I get the nice help text, but no upload form. The table renders fine in both scenarios and I'm not seeing any errors.</p> <p>If Drupal uses drupal_render to render its forms why would the form look different in the second scnenario? Is there a way to get the entire form? I've tried a variety of ways of passing the form and using dpm to print the form at various stages and I'm not sure where to go from here.</p> <p>Standard file upload fields render correctly as do other form elements. It seems to be limited to the managed_file element.</p>