5 Jul 2012 3:30 PMJohn Mitchell
Steps to create a form that when a visitor fills in and submits the results, the results are emailed to one or more recipients.
- Add or edit a Page via Administration -> Content Management -> Pages
- Place your cursor in the content where you want to insert the form
Click the "Form" icon in the toolbar and fill in the following properties
- Enter a Name of the form
- In Action input "Default.aspx?PageType=EmailForm&ArticleFileName=[Page Name]"
- In Encoding select "Multipart/Form-data"
- In Method select "POST"
- When you click Ok you will see a red dotted box, place your form fields within the red dotted box by selecting them from the toolbar.
Important: you need to go to "Source" and add an attribute to the form element as follows:
<form runat="server" ...
You may also include the following hidden fields (also selectable from the toolbar)
- Subject - the value entered here will be the subject line of your email. If not include then the Title of the page will become the subject.
- Recipients - comma separated list of email addresses. If not included then the Administrator's email address becomes the recipient.
- EmailPageName - this is the name of the page used when email the results. The results are merged to this page. If not included a page is automatically generated.
- AttachmentFormat - if value is "csv" then the results are attached to the email in a Comma Separated Values (CSV) file which you can use to import into another program.
- RedirectURL - this is the name of the page or URL to redirect to when successful. i.e. a Thank you page.
- OnSuccessMessage - if RedirectURL is not included then this is the message that is displayed when successful. If not included then "Completed Successfully" is displayed.
To make fields Required you need to go to the source and add the following attribute to the input, textarea or select elements you want to force the user to enter:
<input required="true" ...
<textarea required="true" ...
<select required="true" ...