Difference between revisions of "Webforms"
From Stadm
Jump to navigationJump to search (→Setup) |
(→Setup) |
||
Line 9: | Line 9: | ||
##On this page, you can set the title of the webform. The body field can be left blank. | ##On this page, you can set the title of the webform. The body field can be left blank. | ||
##Click URL Path Settings below the body and type the page name and path you would like the form to appear on | ##Click URL Path Settings below the body and type the page name and path you would like the form to appear on | ||
− | + | #On the next page you can add components to your webform | |
##Components are things like textareas, file upload forms, date fields etc. | ##Components are things like textareas, file upload forms, date fields etc. | ||
##These as well as their labels will appear on your form (except those with the type 'hidden') | ##These as well as their labels will appear on your form (except those with the type 'hidden') |
Revision as of 15:36, 16 August 2012
Out of the box, the Drupal Webform module provides a content type that builds a form on a page with several customizable elements including text, email and textarea for emailing content to a static email address configurable through the webform E-Mail settings in the Webform content type. Creating a contact form that sends emails to a variable address can be done using hook_form_alter.
Setup
- Webform should be enabled, and in its module configuration settings, Webform-enabled content types should be set to Webform. The Default Email Values in this menu can be left as they are.
- Once the module is enabled, you can add a new webform by going to admin->content->Add Content->Webform.
- On this page, you can set the title of the webform. The body field can be left blank.
- Click URL Path Settings below the body and type the page name and path you would like the form to appear on
- On the next page you can add components to your webform
- Components are things like textareas, file upload forms, date fields etc.
- These as well as their labels will appear on your form (except those with the type 'hidden')
- Content in hidden fields is accessible by the form application, but not viewable or editable by the user.
- For a contact form, you should add the following fields
- To (fieldset) - This is an non-editable field that displays the name of the recipient
- From (textfield) - This is where the user will type their own name
- Email (textfield) - This is where the user will type their own email
- Subject (textfield) - A subject can be added
- Message (textarea) - This is where the message goes
- To Email (hidden) - this will not be displayed on the form, but will retrieve the recipients email from the drupal database
- Click the E-Mails link below the Webform tabs
- Select "Component Value", and chose the field that you created for the recipients email ("To Email" in this example)
- Click Add
- The form is now set up. You can view it by navigating to the URL that you gave the form in step 2.