Everything Photoshop Subscribe

Build Seamless, Fully Functional Forms with No Coding

In HTML / CSS by Collis Ta'eed

Forms are the backbone of the interactive web, but as a non-programmer, they've always been a bit troublesome. Being the lazy designer that I am, I always look for ways to make my life easier. So today I'm going to show you how to use a form building service called Wufoo to make forms that fit right into a website, completely seamlessly - that is to say, the user shouldn't be able to tell that you've used Wufoo at all, not through the design or the web address.

What kinds of forms can you make? All sorts, from contact forms to surveys to ones that interact with PayPal. If you're a web designer who perhaps isn't familiar with server-side languages like PHP, then you'll love this, because you'll never need to worry about adding forms to a website again.

The Brief

Some weeks ago I wrote a tutorial on building a simple homepage that used Twitter and CushyCMS to make it super easy to manage. The website we built is my own little domain - CollisTaeed.com - and while I'm happy with it, there is one major flaw. At the bottom of the page I give my email address. But wouldn't it be better to have a little contact form there, thus protecting my email address from spam? Well that's what we're going to do!

Here's what I want the page to look like when we're done:

And then once the form is completed, I want that form to be replaced by a little message like this:

Step 1 - Getting Started with Wufoo

So first things first, we go to Wufoo.com to get an account.

If you've never used a service like Wufoo or Formspring, what they do is to let you drag and drop forms together with all sorts of features. They host the forms and take care of all of the form handling, including all the usual form validation, file handling, paypal integration and all sorts of stuff. It's pretty cool and worth exploring the site to learn more.

There are pricing packages to choose from, in this tutorial you can do almost everything but the last step (redirecting after the form) using the free package. I've set myself up on the "Ad Hoc" plan.



Step 2 - Creating our Form

Once you have an account just click on Forms and create your form. It's fairly straightforward to do and you can figure it out just by clicking around.

Anyhow here's the form I've made!

Step 3 - Creating a Theme

Now that's a nice form, but right now we have two major problems:

  1. The form looks totally different to the site
  2. The form is at a weird URL - http://collistaeed.wufoo.com/forms/contact-collis/ - and not on my page

So let's deal with the styles first. So we'll create a new Wufoo Theme with our own CSS to make the form match. Here's what you need to do:

  1. Click on the Themes tab
  2. Down the bottom you will see a link that reads Wufoo Form Gallery
  3. Download the CSS for the Gray theme. This will be our starting point and we'll just modify that to look right

Step 4 - Adapting the Theme Files

Once the theme is downloaded we open up the files to find a series of files, most of which we can ignore completely. Here's what the file structure looks like:

The two files we need are:

  1. index.html - We don't need to alter this file in any way, just to open it in your favourite browser to use for testing.
  2. theme.css - this is the CSS file we will be working with

Now unfortunately the CSS isn't very straightforward. This is because the Wufoo people have strewn style definitions all over the shop; some are in form.css, some in structure.css and of course lots are in theme.css. That means when we put in our CSS definitions we not only need to define our own, but we also have to make sure we overwrite any existing ones.

I recommend using the Firefox extension, Firebug, to figure out what HTML elements are being affected by what CSS selectors. If you're not familiar with Firebug, you might like to check out our NETTUTS tutorial on Firebug here.

So anyhow after a big of fiddling about in Firebug and Dreamweaver, here's my final theme.css stylesheet:

/* - - - Custom Theme - - - */
/*
	Note that I have simply gone through each class and overwritten it with 
	my own definitions to match the form to my collistaeed.com website. 
	It's a bit of a messy stylesheet, but that's OK, it works! :-)
*/

/* Backgrounds */
body, #container, body.embed{
	background-color:#191e25;
	margin:0; padding:0;	
	color:#5f6874;
	font-family:"Lucida Grande", "Lucida Sans Unicode", Arial, Sans-serif;
	font-size:13px;
	line-height:21px;
}
h1 a {
	display:none;
}
h1, h2, h3, h4 {
  color:#ffffff;
  font-family:"Lucida Grande", "Lucida Sans Unicode", Arial, Sans-serif;
}
h2 {
	display:none;
}

.wufoo input.text, .wufoo textarea.textarea{
	background:none;
	background-color:#101318;
	border:1px solid #222830;
	padding:8px;
	margin-top:3px;
}

.wufoo .focused{
	background-color:#191e25;
	color:#d2d9e3;
	
}
.wufoo .instruct{
	background-color:#333e4c;
	color:#d2d9e3;
	border:1px solid #434e5f;
	font-size:80%;
	font-family:inherit;
}

/* Borders */
#container{
	border:none;
}
.wufoo .info{
	border-bottom:none;
}
.wufoo .section{
	border-top:none;
}



/* Typography */
.wufoo .info h2{
	font-size:160%;
	font-family:inherit;
	font-weight:;
	font-style:;
	color:#ffffff;
}
.wufoo .info p{
	font-size:100%;
	font-family:inherit;
	font-weight:;
	font-style:;
	color:#5f6874;
}
.wufoo .section h3{
	font-size:110%;
	font-family:inherit;
	font-weight:;
	font-style:;
	color:#ffffff;
}	
.wufoo .section p{
	font-size:100%;
	font-family:inherit;
	font-weight:;
	font-style:;
	color:#5f6874;
}	
.wufoo label.desc{
	font-size:100%;
	font-family:inherit;
	font-weight:normal;
	font-style:;
	color:#aab3bf;
}
.wufoo li div, .wufoo li span, .wufoo li div label, .wufoo li span label{
	font-family:inherit;
	color:#5f6874;
}
.wufoo label.choice{
	font-size:100%;
	font-family:inherit;
	font-weight:;
	font-style:;
	color:#5f6874;
}
.wufoo input.text, .wufoo textarea.textarea, .wufoo select.select{
	font-family:inherit;
	font-weight:;
	font-style:;	
	color:#d2d9e3;
	font-family:"Lucida Grande", "Lucida Sans Unicode", Arial, Sans-serif;
	font-size:13px;
	line-height:21px;
}
.wufoo li.altInstruct .instruct, .wufoo li.leftHalf .instruct, .wufoo li.rightHalf .instruct{
	color:#d2d9e3;
}
.wufoo input.btTxt{
	font-size:;
	font-family:;
	font-weight:;
	font-style:;
	color:;
}

.wufoo li.focused label.desc{
	font-size:;
	font-family:;
	font-weight:;
	font-style:;
	color:;
}
.wufoo li.focused label.desc{
	color:;
}
.wufoo li.focused div, .wufoo li.focused span, .wufoo li.focused div label, .wufoo li.focused span label{
	font-family:;
	color:;
}

/* Drop Shadows */
#top, #bottom{
	visibility:hidden;
}

/* Extras */
form .req {
  color:#c75a33;
}

.medium { width:591px;}

input.btTxt {
  background-color:#d55633;
  border:1px solid #d56d46;
  color:#ffffff;
  padding:4px 15px 4px 15px;
	font-family:"Lucida Grande", "Lucida Sans Unicode", Arial, Sans-serif;
}
input.btTxt:hover { background-color:#ab3d1f; }

I won't go through the styles as it's a little messy because I had to override some Wufoo styles. But basically I've just reset some colours and borders and fonts and made a few things on the page hidden (like the page title and logo) so that they don't interfere with my website.

Step 5 - Upload and Test

So now we rename the CSS file, I changed mine to be called collistaeed.css, and then upload to a server. My stylesheet sits at: http://collistaeed.com/collistaeed.css

Now if we go back to Wufoo and again click on Themes and this time we'll create our custom theme by:

  1. Under Theme select Create New ...
  2. Under Properties select Advanced
  3. Then link up your stylesheet in the form field
  4. and Save Theme

Once this is done you can go back to Forms and set the theme for your form.

Now if we visit my form it looks like this:

Step 6 - Embedding the Form with iFrames

Now that our form is looking good, it's time to stick it into the page. We can do this by using an iFrame.

The name iFrame stands for inline frame, and that's because it's basically a little frame window in the middle of your page to another page. Using an iFrame we can place this Wufoo page into my regular HTML page and to the end user it will look like a single page.

And happily Wufoo even provides the iFrames code for us. All you do is go to Forms and then click on Code and you'll get three options - Integrated Form Code, Full Page Form Code and XHTML/CSS Code Only. We need the first option - Integrated Form Code.

Here's the iFrame code for my form:

<iframe height="629" allowTransparency="true" frameborder="0" scrolling="no" style="width:100%;border:none" src="http://collistaeed.wufoo.com/embed/contact-collis/" title="HTML Form"><a href="http://collistaeed.wufoo.com/forms/contact-collis/" title="Contact Collis">Fill out my Wufoo form!</a></iframe>
<small><a href="http://wufoo.com/">Powered by Wufoo</a></small>

And of course I can even stick my form in right here on this NETTUTS page, like this:

So all we need to do is delete that "Powered by Wufoo" bit there (a nice sneaky attempt to get their link on our page), adjust the iFrame height a little (because otherwise error messages cause some cut off) and place it in my HTML page! Here's how it looks:

Step 7 - Where to after that?

Now there is one problem at the moment. After you send the form we get a big white Wufoo page appearing in the iFrame saying something about your form submission being successful. But we want to use our page. So first of all let's create a HTML page called success.html on the server using this HTML:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<title>Collis Ta'eed - A Little About Me</title>
	<link rel="stylesheet" href="style.css" type="text/css" media="screen" />
	<style>
	
		#success {
			margin:auto;
			width:310px;
			margin-top:30px;
			text-align:center;
		}
	
	</style>
</head>

<body>

	<div id="success">
      <p><img src="images/form_success.jpg" /><br />
        Your contact submission is now winging it’s way to my inbox.  Please be patient with me as I get a lot of email so I may take a while to respond!</p>
      <p><a href="index.html">Return to Homepage</a></p>
	</div>


</body>
</html>

You can see this page at http://collistaeed.com/success.html. Next we'll go into Wufoo and edit the form to give it a Return URL. Note that to complete this step you need to have a paid Wufoo account. Fortunately I have the cheapest plan so that's no problem! In the screenshot below you can see where you enter the Return URL:

Finished!

So there you have it, to the casual observer it's not at all obvious that we've used an external form processor. By logging into Wufoo you can set notification preferences so that you can pick up the form mail. And it didn't involve any code at all.

The hardest part of this process is the styling because Wufoo's templating isn't very easy. One other annoyance is that the return URL breaks out of the frame. Ideally that final HTML page should have appeared in the iFrame so that the user never leaves the page.

If you're interested in trying out a form provider, you might also want to look at FormSpring, who do pretty much everything that Wufoo does. And there are probably other form processors out there too, if you know some, please leave a comment!

Enjoyed this post? Your vote is always appreciated!! Delicious StumbleUpon Float Digg

Comments

Leave a Comment
  1. Absolutely fantastic tutorial as always Collis!

  2. Collis,

    I have found JotForm to be a better service (and cheaper). Plus they provide you the code to embed the form in your site without the need to use iframes. But I must admit, WuFoo has better built-in styles.

    Vin

  3. Well Done

  4. I always stick with plugins and extensions that handle the forms for me. Seems like an easier option than this paid program, but thanks for sharing!

  5. Interesting tool. Never heard of it. Personally I like the free, natemail script.

  6. Great as always. I really a have picked up a lot from your tutorials.

  7. Great ive been useing wufoo for a year

  8. Couldn’t be easier than this and wufoo indeed is a very powerful tool.

  9. A great tutorial as usual.

    Wufoo looks like a dreadful application. Their rates seem extortionate and the process of building forms is by no means simple. The finished form is far from perfect. CSS seems to be all over the place. If users have CSS disabled they will see a horrible mess.

    100 entries a month is all you get with the free package. What if someone starts spamming you? It would be all to easy for a bot to spam you without any form of CAPTCHA.

    I have a couple of questions. Does Wufoo email you the contents of the form or do you have to log into their site to view responses? Is all that CSS really necessary? Why all the empty rules?

  10. I´m using formassembly.com on one of my websites.

  11. I agree with thomas. And why for **** sake use an iframe?

  12. i like to use plugins more… seems more compatible. this seems okay tho

  13. Thanks for the post. :)

  14. Hey guys, I must admit while writing this tutorial I discovered that Wufoo was a little more clumsy than I thought it was going to be. I’ll have to check out those other apps - Jotform, FormAssembly etc - and see if they’d work any better. This actually turned out to be quite a bit of work :-)

  15. Wufoo forms are great - thanks for the tutorial :)

  16. I would still prefer to make my own forms with html and php. Sometimes even Javascript.

  17. I tried to do this on my own website and it worked a treat after some hearty HTML/CSS coding. Thanks for the tip off!

    My only complaints would be the lack of any spam protection (no captchas), and the advert that’s displayed after you submit the form… but hey it’s free so I’m not complaining.

  18. I don’t like this at all! Get down and dirty with a bit of PHP and you are much better off than you are pissing about with crap online services!

    Andrew

  19. The downside to this is if the user is an idiot (which every designer/developer should presume) and does not enter an email or name, then the validation pushes the form down about 80pixels and the SUBMIT button disappears because the iframe does not scroll.

    An easy fix would be to make the iframe a bit taller, or to make your own version.

    Wufoo is great and this tutorial should help a lot of people. Thanks!

  20. nice reading, but I prefer make my own form

  21. I use formtools from http://www.formtools.org/, it’s a self-hosted form processor that allows you to easily create, edit and host your own forms - no matter the size. You’ll need a little more knowledge than wufoo, but it’s free and much, much better - especially if you don’t care for the wufoo style, like me, I just creat my own styles from scratch.

  22. I take your point about making your life easier, but I still think it’s better to do the job yourself.

    Using a third party always feels like a compromise at the integration stage - using an iframe certainly isn’t my cup of tea.

  23. such a bad idea to pay for something else to build your forms for you it takes like 2 minutes to build a basic form and style it this a way more complicated process. just my .02 cents

  24. I have used Woofoo before, but I think Appnitro Machform ( http://www.machform.com) is a way better option that this tool. You only have to pay a little fee once and you can get the entire webapp to host on your own server to make as many forms and you want. Plus you can customize the email and many other things.

    I really recommend people checking that out.

  25. Great Tutorial!! But i prefer the Free Option - MachForm, It uses the Same principles as the Other sites mentioned but is Free :) no Monthly cost, but it is Self Hosting

    MachForm - http://www.appnitro.com/

  26. Wufoo is groovy - but I’d e to see a tut about how to wire up a contact form myself (with all the coding and whatnot).

  27. I learn a lot from the tutorials, but I always get so much information based off of the great user base here. Thanks a lot to those who posted other alternatives and to Collis for the initial tutorial!

  28. Eh..create a basic form with any WISYWIG and learn some simple css..bam! easy, free

  29. Gravatar

    jake randell

    yay!!! i used as a guide to make:

    http://jakerandell.elementfx.com/

  30. collis, you are the man.

  31. great stuff! I can do this stuff myself but this will save me a lot of time.

    thanks

  32. You always share awesome usage of simple stuff. Its great!

    Thanks for sharing all neat stuff with us.

  33. Thanks for sharing Collis! Wufoo looks pretty handy! This might redeem iframes… maybe…

    Aaron - Yes you could do with WYSIWYG - with HTML/CSS, but you’d have to learn a back-end technology as well! - like PHP or RoR

  34. Wufoo’s definitely an awesome service, but the free version only allows up to 100 entries, which as a start is more than enough - but once your site gets more traffic, that cap can easily be reached quickly.

  35. I love wufoo forms! We use them for class registration and have the service integrated with an authorize.net account. Totally easy and worth the $24 a month!

    Niki Brown

  36. Interesting TUT Collis. It looks like a pretty good service however I would prefer to get a DEV monkey to create a reusable form for me which saves me:

    - My own dev time
    - More reoccurring monthly fees
    - No dirty Iframes on my pages

    I am of the opinion that we should use our development brethren’s and leave the coding to the pros. Once you have a template it is east to reuse over and over.

    Otherwise another meticulous and perfectly proportioned tutorial.

    Cheers

    Sci

  37. I’ve been using Wufoo on my site for about 2 years and it works great.

    Definitely the best solution to build an online form in no time.

  38. thanks for this post Collis

    @Paul, thanks for FormTools

  39. Gravatar

    Jatin Meshiya

    Great Collis. I have tried it and it wow! Please tell us all your lazy stuff!!! (just joking). Hey will you please let us know all the stuff that makes your work flow easy? You have knowledge and I think if you spread it you will also find some good inputs to make your path more smooth. U must Try it!

  40. Nice tips but to be honest, wufoo is quite expensive :D

Add a Comment

Note: We use Gravatars on NETTUTS, they are little icons that appear next to your name on this site and on many others. You can get a Gravatar account for free and any other site that supports it will show your avatar too!

 

Trackbacks

Leave a Trackback