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 the 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 requires “Chaos tools” and “Views” module for installation, so install those modules before enabling the Webform module.
Add Content
After enabling the module, one new Content type named “Webform
” will be created 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 creating 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 changing 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, enable the email alert after any form submit, change the submission setting of the Form.
- Results: From there, you can check 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 adding any text in the form in any place.
- Use Select option to add checkbox or radiobutton field. On the setting on the field check “Multiple” to make the field checkbox and uncheck to make it radio.
- Use “
Fieldset
” to add some fields in, you can make the fieldset collapsible. Drag any field under the fieldset. - Use “
pagebreak
” to break the form in multiple pages.
So the module is too easy and it has multiple options. You can manage your form 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.
CodeProject