The Wufoo Blog

Using Wufoo Forms in Fixed Height Containers

By Chris Coyier · August 19th, 2010

Does your website’s layout have an area you would like to use a Wufoo form, but that area has a fixed height, i.e., a size that cannot grow taller or shorter depending on the content inside? If you are in this position, you can still use a Wufoo form! Wufoo forms adjust themselves in height by default, but you can override this, set a fixed height, and allow your form to have a scrollbar very easily.

Scrollbar Forms

JavaScript embed code adjustments

The trick here is changing the value of the autoResize parameter to false and changing the height parameter to your desired height:

<script type="text/javascript">var host = (("https:" == document.location.protocol) ? "https://secure." : "http://");document.write(unescape("%3Cscript src='"   host   "wufoo.com/scripts/embed/form.js' type='text/javascript'%3E%3C/script%3E"));</script>

<script type="text/javascript">
  var x7p4s5 = new WufooForm();
  x7p4s5.initialize({
    'userName':'examples', 
    'formHash':'x7p4s5',

    /* Changed to FALSE for scrollbars */ 
    'autoResize':false,

    /* Setting a fixed HEIGHT */
    'height':'514', 

    'ssl':true});
  x7p4s5.display();
</script>

Now the automatic height resizing of the form will stop, it will be of a fixed height, and if the form is (or ever becomes) taller than the fixed height, there will be scrollbars allowing the entire form to be seen.

This entry was posted 1 year ago and was filed under News & Updates. Comments are currently closed.

Comments

  1. Thanks, as always making life easier :)

    Posted 1 year ago by Adriana.
  2. Everyone needs a hug.Thanks guys! This is fantastic! I’ve had this problem and now you’ve come to the rescue.

    Posted 1 year ago by Rob.
  3. Love it! Except it doesn’t apply to the payment page :(

    Posted 1 year ago by Anthony.
  4. Hi Athony, that’s strange. It might be a bug on our end. We’re looking into it now.

    Posted 1 year ago by Kevin Hale.
  • Search

  • About

    The Wufoo Blog is the official online publication written by the developers of Wufoo about their online form builder, form-related technologies, and whatever else may fit their fancy—like robots.

  • Archives

Need Your Help