Simple Block Forms in Drupal

Simple forms on websites are a common feature request. So, when we added a sign-up form to the Geeks and God homepage it was no surprise when I was contacted asking how we did it. Typically, when forms like this are built in Drupal (the CMS powering the site) they are done as a full page. In this case it was just a simple block on the homepage. Here are 3 ways to create a simple block form.

Google Docs Form

One simple trick is to take a form created in Google Docs and embed it within a page or a block. In order to embed the iframe in a page or a block you'll need an input format that will let the iframe tag pass. For security reasons this should not be an input filter available to site users.

If you hadn’t noticed, this is the method we used to embed the form on the Geeks and God podcast. If you look at the source you’ll see an iframe and Google.

Webform

A Drupal specific solution is to use the webform module. This module lets you add configurable forms to your site. You can download the form results, have them emailed to you, and so much more.

By default the forms are full pages. If you want to have these form in a sidebar or the footer you need the Webform Block module which adds webforms to blocks to be positioned anywhere.

Webform Block Example
A Webform in a footer block.

Simplenews

A 3rd option, if you're looking for a sign-up form is to use Simplenews. With this option you can create a newsletter, collect email address, and then send out updates fairly easily.

Choosing One

Using Google or the webform module are fairly similar options. The big difference is in who has their hands on the data. Using the Simplenews option is quite different so know its the right tool before choosing it.