Comment 2 for bug 836804

Revision history for this message
Kitserve (ubuntu-kitserve) wrote :

Wrapping the contact form (and other modules) in a <div> will only work if the module tags aren't input into TinyMCE but controlled by some other means. Otherwise you'll end up with <p><div class="contactform"><!-- contactform code --></div></p>, which doesn't fix the problem.

I have a workaround but it's a bit of a hack, by changing the last section of contactform.site.php to the following:

 //Then show the contactform.
 ?>
</p><!-- ADDED THIS -->
  <form method="post" action="" id="contactform">
   <div>
    <label for="contactform_name"><?php echo $lang['general']['name']; ?></label>
    <br />
    <input name="contactform_name" id="contactform_name" type="text" />
    <br />
    <label for="contactform_sender"><?php echo $lang['general']['email']; ?></label>
    <br />
    <input name="contactform_sender" id="contactform_sender" type="text" />
    <br />
    <label for="contactform_message"><?php echo $lang['general']['message']; ?></label>
    <br />
    <textarea name="contactform_message" id="contactform_message" rows="7" cols="45"></textarea>
    <br />
    <input type="submit" name="submit" value="<?php echo $lang['general']['send']; ?>" />
   </div>
  </form>
<p><!-- ADDED THIS -->
 <?php
}
?>

All it does is close the <p> tag before outputting the contact form, and then open another one afterwards so the tags match. It validates correctly and the layout seems unaffected (on Firefox and my site theme, haven't tried other browsers and themes), it's not exactly elegant though!