Tanmay Maity

Drupal: Create Form using Webform Module

Leave a comment

In Drupal, it is very easy to create a Form such as Contact Us Form or Registration Form. No need to create any custom module to create any Form as one powerful and top rated module is already present in Drupal, that is Webform Module. Any beginner can work with this module because this is too easy.

Module Install:-  Install Webform module is same as any other module installation. Copy Link location of latest Webform module tar.gz file from https://www.drupal.org/project/webform. Login as Admin in your Drupal site and from Admin Dashboard go to Modules -> Installed New module, paste the link location and install the module. After successful installation don’t forget to enable the module.

Note 1: If you are new in Drupal and if the “Installed New Modules” link is not present in “Modules” section of Admin dashboard then find the “Update manager” module from the module list and check the module and save the configuration.

Note 2: The Webform module require “Chaos tools” and “Views” module for installation, so installed those module before enable the Webform module.

Add Content:- After enable the module, one new Content type named “Webform” will create automatically. You can check that from the Content Type section from Admin dashboard. Now you have to create a new Content of Webform Content Type. Go to Add New Content and select Webform from the Content type list.

Webform Options:- After create the new content ( Webform content type )  you will find 4 tabs in the content type if you logged in as Admin. These are “View”, “Edit”, “Webform”, “Results”. Now check the functionality of those tabs.

  • View: From that tab you can check the preview of the webform. After change anything in the Webform check the preview of the Webform from this tab, no need to check the web page where you are using the Form.
  • Edit: From the tab you can change the settings of the Webform. You can add the Webform in the menu list, you can allow to add comment on the Webform, you can use custom URL for the webform, you can change the Author name and date of the webform.
  • Webform: Form this tab you can “Add Fields” in the Form, unable the email alert after any form submit, change the submission setting of the Form.
  • Results: From there you can check the all submission value.

Add Fields: You can add the fields from Webform tab. In Webform tab one sub tab is present that is “form components”. From there you can add any fields you want. You can add text, textarea, checkbox, radiobutton, email field, hidden field, markup, number field etc.

  • Use markup field for add any text in the form in any place.
  • Use Select option to add checkbox or radiobutton field. On the setting on the field checked “Multiple” to make the field checkbox and uncheck to make it radio.
  • Use “Fieldset” to add some fields in a are, you can make the fieldset collapsible. Drag any field under the fieldset.
  • Use “pagebreak” to break the form in multiple page.

So the module is too easy and it has multiple option. You can manage your From using this module. You can add “Webform Validation” module to add the validation in the fields. You can use “Webform2pdf” module to create the PDF after any submission.

Leave a comment