I am attempting to theme a webform. I have done this on my other sites running webform 2.8 and Drupal 6. On this site I have created the webform-form-$NID.tpl.php and it all the code like the other site. The page renders the input fields fine. But the submit button and the capthcha, wont render out. Something must have changed or I don't have something right. I have attempted to print out the render info but i am having trouble deciphering the info.

I will post the code below, if anyone can help me out, that would be great. Also, if anyone has any pointers on how to figure this out, I would really appreacite it, I have the DEvel mod, but cannot figure it out with that either.

<?php
// $Id: webform-form.tpl.php,v 1.1.2.4 2009/01/11 23:09:35 quicksketch Exp $

/**
 * @file
 * Customize the display of a complete webform.
 *
 * This file may be renamed "webform-form-[nid].tpl.php" to target a specific
 * webform on your site. Or you can leave it "webform-form.tpl.php" to affect
 * all webforms on your site.
 *
 * Available variables:
 * - $form: The complete form array.
 * - $nid: The node ID of the Webform.
 *
 * The $form array contains two main pieces:
 * - $form['submitted']: The main content of the user-created form.
 * - $form['details']: Internal information stored by Webform.
 */
?>
<?php
  // If editing or viewing submissions, display the navigation at the top.
  if (isset($form['submission_info']) || isset($form['navigation'])) {
    print drupal_render($form['navigation']);
    print drupal_render($form['submission_info']);
  }

  // Print out the main part of the form.
  // Feel free to break this up and move the pieces within the array.
  ?>
  <?php 
  
  unset($form['submitted']['name']['#title']); 
  unset($form['submitted']['email']['#title']); 
  unset($form['submitted']['comment']['#title']); 
  
  unset($form['captcha']['#type']);
  
  ?>
  
  <div id="webform6212">
  <table width="100%" border="0" cellpadding="0" cellspacing="0" class="formtable">
  	<tr>
    	<td class="formlabel">Name:</td>
  		<td class="forminput"><?php print drupal_render($form['submitted']['name']);?></td>
  	</tr>
    <tr id="forminputshim">
          <td class="formlabelshimwht"></td>
          <td class="forminputshim"></td>
    </tr>
	<tr>
    	<td class="formlabel">E-mail:</td>
  		<td class="forminput"><?php print drupal_render($form['submitted']['email']);?></td>
  	</tr>
    <tr id="forminputshim">
          <td class="formlabelshimwht"></td>
          <td class="forminputshim"></td>
    </tr>
    <tr>
    	<td class="formlabel">Comment:</td>
  		<td class="forminput"><?php print drupal_render($form['submitted']['comment']);?></td>
  	 </tr> 
     <tr id="forminputshim">
          <td class="formlabelshimwht"></td>
          <td class="forminputshim"></td>
    </tr>
    	<tr>
    	<td class="formlabel">Captcha:</td>
  		<td class="forminput"><?php
      print drupal_render($form['captcha']['captcha_widgets']);?></td>
  	</tr>
     <tr id="forminputshim">
          <td class="formlabelshimwht"></td>
          <td class="forminputshim"></td>
    </tr>
    	<tr>
    	<td class="formlabel"></td>
  		<td class="forminput"><?php
        print drupal_render($form['submit']); // print the submit button
      ?></td>
  	</tr>
  </table>
  </div>
  
  <?php
  print drupal_render($form['submitted']);

  // Always print out the entire $form. This renders the remaining pieces of the
  // form that haven't yet been rendered above.
  print drupal_render($form);

  // Print out the navigation again at the bottom.
  if (isset($form['submission_info']) || isset($form['navigation'])) {
    unset($form['navigation']['#printed']);
    print drupal_render($form['navigation']);
  }
?>
  <?php 
print '<pre>';
print_r(get_defined_vars());
print '</pre>';
?>

Comments

joshfromdallas’s picture

Status: Active » Closed (fixed)

I solved my problem, For some reason it is under ['actions']['submit'] and same for the Captcha.

Hope this helps someone else