(How To) How to use the Webform module to create custom forms for your Drupal Website
Tips: How to use the Webform module to create custom forms for your Drupal Website
The Drupal Webform module by Nathan Haug aka “quicksketch” is in my book rates up there in the top ten most important Drupal modules in existence and it’s not that hard to use once you understand how it works. This is a brief tutorial designed to help people get a handle on the Webform module quickly so they can start using it to add web forms to their website. Note: This tutorial is written in the context of Drupal 6. There may be minor differences for Drupal 5 installations.
Once the Webform module is installed and user permissions are set then you will have a new link added to your Navigation menu under “Create Content” that reads “Webform”. Simple enough. Click the link and it will take you to create your new page.
Webforms are a bit different then other content types because the creation of the form is broken up into several stages. The first stage looks just like any other node creation page, with the distinction that instead of a “Body” you have a “Description”, and an additional field called “Confirmation message or redirect URL”. You must add the title as always.
The Description field is where you place the text that you want to be visible at the top of the web form to give instructions as to how to fill out the form etc… For an example of the description field you can visit my contact page to see what I am talking about.
The “Confirmation message or redirect URL” field is also important in that it gives you a chance to decide what users will see immediately after submitting a form. If you enter a URL for an existing page on your site the user will be redirected to that URL after the form submission. This can be useful if you have multiple forms on your site and you don’t want to edit the confirmation messages separately.
“E-mail to address” will default to the main admin email on the site, but if for instance you wanted to use the form to allow people to send a message to their congressman or something like that then you could enter the congressman’s email here.
“E-mail from name” Defaults to the name of your website, however you could change this to have it show as coming from the user who filled out the form once you have added an email form to the field, but alas I am getting ahead of myself here, I’ll come back to this once we have the fields in place. Same goes for the “E-mail from address” as well as the “E-mail subject” fields.
Webform advanced settings offer some interesting possibilities for validation and such, but that goes beyond the scope of this tutorial for now.
Courtesy : Pixelclever.com
- guru's blog
- Login to post comments
![Drupal-6-Book-[Building Powerful and Robust Websites with Drupal 6].jpg](http://www.drupalranch.com/images/Drupal-6-Book-[Building%20Powerful%20and%20Robust%20Websites%20with%20Drupal%206].jpg)