The Wufoo Blog

New JavaScript Embed Form Code Snippet

By Kevin Hale · April 8th, 2009

Earlier this week, we quietly released a JavaScript version of our Embed Form Code snippet in the Code Manager so users can dynamically insert their Wufoo forms into their web sites using a script instead of a static iframe. It’s a feature that a lot of our power users have been anxiously waiting for and we’re excited to be able to say that this JavaScript version provides a number of enhancements over the older iframe only version.

JavaScript Embed

While the old embed form code snippet served us and our users well, it had a few drawbacks that made integrating Wufoo into a web site less than ideal. Here’s a list of some of the benefits of this new JavaScript version and why you might want to consider replacing your current iframe embed snippet with the new and shiny:

  • Auto-Resizing - The new code snippet can automatically detect the exact height of your form as seen by your users and insert it without having to add extra space beneath the form to prevent cropping. Additionally, it’ll automatically resize itself if your form shows errors after validation and even on the confirmation message page. That means no more cropped Submit Buttons and no more wasted blank space beneath the form that needed to be reserved for potential error messages. Nice and clean and only what you need.

  • Faster Loading - Because scripts are executed before iframes in the browser rendering order, your forms will appear to load faster on your web pages because they’re dynamically inserted. Combined with our new caching system for public forms, you should notice this embedded version loading faster than its iframe only counterpart.

  • Easier Access to Features - The JavaScript snippet has a number options that make it much easier for the user to manipulate the embedded form code. You can just as easily turn off the autoResize feature (autoResize:false), force a specific height (height:600) and on Bona Fide plans and higher, easily turn off SSL for your embedded form (ssl:false).

  • Foundation for Paging - One of the big reasons we had to tackle an auto-resizing embed method was to create the groundwork for inserting forms with multiple pages. Since we know that different pages could have different heights, we needed a more versatile way to insert Wufoo forms into a web site. Now that this is done, we’re on to the next step!

A big thanks goes out to Ryan and Alex on the Wufoo Team, who brought in the magic on this one. For users that are using content managers or systems that do not allow for JavaScript to be inserted into their environments, you can still find the tried and true original iframe version in the Code Manager beneath the JavaScript version. This feature is available to all users on all plans and has been thoroughly tested to work in Internet Explorer 6 and higher, Firefox and Safari.

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

Comments

  1. This is a great way to embed forms but I see a major drawback as far as I’m concern. The Auto-Resizing feature doesn’t seem to work on Safari 3. As I can’t afford to have my forms not accessible for Safari users, I’m still using iframes. Do you have any feedbacks on that issue ?

    Posted 5 years ago by Mike.
  2. Hi Mike, we’ve actually done testing of the script in Safari 3 and higher and it works on our end. Can you send a link to your page with the embedded form to support so we can take a look at it?

    Posted 5 years ago by Kevin Hale.
  3. Thank you for this update! The auto-resize is critical.

    Posted 5 years ago by Chris.
  4. One of the biggest problems I had was with iframe heights, so THANK YOU soooo much!

    Posted 5 years ago by Seth Stevenson.
  5. Great news, guys. Love the service and this was one of the small things I wasn’t crazy about. Goodbye iFrames, hello javascript!

    Posted 5 years ago by Eric.
  6. I love this new feature but I was wondering how to change my form website name, thanks!

    Posted 5 years ago by angela.
  7. This is great news! Can’t wait to use it on a few of my sites.

    Posted 5 years ago by Maurice Cherry.
  8. This is great! Well done.

    (Will it reflect a site’s CSS by the way?)

    Cheers,

    Galen

    Posted 5 years ago by Galen.
  9. Kevin> You can find my form at this adress : http://www.supbiotech.fr/test-page-for-wufoo.html

    It is embeded correctly, but if you don’t fill any field and click on the submit button with Safari, the form’s height increases and the last fields and button disappear.

    This happens both on Mac OS and Windows.

    Posted 5 years ago by Mike.
  10. I’m looking forward to the multi-page forms. At the moment one of my forms has around 20 questions and is a bit intimidating - I think if it was split into 2 or 3 pages with only a few questions on the first page then it will really increase the number of responses.

    Posted 5 years ago by Andrew.
  11. Mike,

    If you are still following this thread, can you submit a ticket at wufoo.com/support. I have a few questions for you about the problem. Thanks!

    Posted 5 years ago by Ryan Campbell.
  12. Is there a way to set field default values (similar to /def/field1=XXXXX) using the JS embed code?

    Posted 5 years ago by Tim.
  13. Ryan > I tried to but your form doesn’t work. It keeps telling me :

    “#There was a problem with your submission. Sorry, but this form can no longer accept file uploads.”

    Even though I don’t try to upload any file.

    You can contact me on my email or here, I’ll keep checking this thread for feedbacks.

    Posted 5 years ago by Mike.
  14. Tim, default values still work. I’ve updated the docs to show you how (http://wufoo.com/docs/url-modifications/)

    Mike, I believe that form is fixed now. We had two other users with the same problem as yours, and clearing your cookies should fix the problem. If you do that, and are able to still recreate the problem, please let us know because it may lead to the initial cause.

    Posted 5 years ago by Ryan Campbell.
  15. Great news - will look to make use of this asap - hopefully solves the scrollbar issues we were seeing in IE6 (yes I said IE6).

    Posted 5 years ago by Rob Holmes.
  16. Auto-Resizing and Faster Load Times … these were the only 2 issues I had hmmm well “issues” with. Problem solved and Wufoo even better!!!

    Posted 5 years ago by Greg.
  17. Is the iframe old code still active ? Should user switch all their code to the JS quickly ?

    Posted 5 years ago by Patrice Albertus.
  18. Ryan > I managed to submit a ticket this time (even joined a screenshot). Hope we’ll figure this out.

    Thanks for your help.

    Posted 5 years ago by Mike.
  19. Everyone needs a hug.

    Posted 5 years ago by michael.
  20. Really nice job on this new feature. Thanks!

    Posted 5 years ago by Jay Owen.
  21. Will this snippet work in iWeb websites? Our school would love to use your online forms. Thank you!

    Posted 5 years ago by Kathy Marrs.
  22. Everyone needs a hug.

    Posted 5 years ago by Downloads da Hora.
  23. Yeah, cool new feature : )

    Posted 5 years ago by Bjarni.
  24. I really, really, really appreciate the Iframe being gone now because it was a very big pain the buttock

    Posted 5 years ago by niels nielsen.
  25. Everyone needs a hug.

    Posted 5 years ago by Blaf Animes.
  26. Everyone needs a hug.

    Posted 5 years ago by rizkykahapsari.
  27. Yeah, good site, but it fact MyTaskHelper.com is more versatile and powerful.Thanks.

    Posted 5 years ago by igor.
  28. Everyone needs a hug.

    Posted 5 years ago by 姚艳辉 .
  29. Can i embed the contact form on a flash site? ex. contact.swf

    Posted 5 years ago by Ale.
  30. Sorry, I’m afraid we don’t have a flash embed method.

    Posted 5 years ago by Kevin Hale.
  31. Any updates on when we might be able to make create separate pages in our forms? This is currently the only reason I am using Form Assembly over Wufoo.

    Posted 5 years ago by devon strang.
  32. Wow! I’m sure you guys have heard it before but this site is just too damn cool, I couldn’t contain myself enough not to say it. I do a fair amount of front (and bit of back) end web design work and making good looking forms that work well is just one of those pain in the rear things. Thanks so much, before long I’ll be grabbing that upgraded account!

    Posted 5 years ago by Jeremy Freehill.
  33. any chance you can make it so that embed code can be added to the bottom of any forum? I am thinking of use in a webinar or organizing event that people might want to go to the event …and share the opportunity to register with their audiences on their distributed sites.

    Posted 5 years ago by Marty Kearns.
  34. hi there Wufoo guys, thank the heavens for you all because I was going seriously bananas trying to figure out the whole ‘contact form’ issue, and no coder I talked to seemed able to help (unless I paid them very big $$$$). So I am loving the javascript form which has integrated seamlessly right where I wanted it on my blog, in the right hand side panel. My ONLY issue - and forgive me for my Java ignorance - is that it looks a tad unfinished and I’d love to be able to create a bit of a margin around the fields and the headline so they’re not squashed up the sides of the form. I’d also love to slap a simple border on it, so it just looks a bit classier. I could do this in HTML but not sure how to tackle it in Java. Is there a way? I’d be hugely grateful for any advice as I’m about to re-launch the blog as an ‘agony aunt’ site and the form will be used heaps, I’m guessing, so I’m really keen for it to look as good as possible.

    Posted 5 years ago by rachel.
  35. Everyone needs a hug.

    Posted 4 years ago by jeetu meena.
  36. I am interested to know how Wufoo does it xdomain. :)

    Posted 4 years ago by FB.
  37. Am I doing something wrong becuase when I use the JS embed script it does not work on ie6? The browser try to load the script without any success, the loading bar never completes. Nothing displays on my page as a result.

    Has anyone else had this problem?

    Click my name to visit my website then click on contact us from the top menu and that is where the wufoo form is. You will see the page does not load.

    Any help is greatly appreciated

    Posted 4 years ago by David.
  • 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