Announcement

Collapse
No announcement yet.

Adding Drop Down Boxes To Contact Us Form (V8 onwards)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Adding Drop Down Boxes To Contact Us Form (V8 onwards)

    1. Please go to 'Design | Library | Layouts' scroll down to 'Web Page Inner Layout' and open the layout 'Contact Us Bulk Area'.

    2. Add a new table row where you want the drop down boxes to be displayed by adding the following code:

    <tr>
    <td> </td>
    <td>
    TITLE
    </td>
    <td>
    <select name="dropdown1">
    <option value="option1">Option 1</option> <option value="option2">Option 2</option> <option value="option3">Option 3</option> <option value="option4">Option 4</option> </select>
    </td>
    </tr>

    change the text 'TITLE' to whatever you wish to appear as the drop down list prompt, and edit each 'option value' to your required value (e.g.<option value="YourOption">Your Option</option> ).

    3. When you are happy Click 'OK' and then check the preview window to ensure it displays correctly

    4. Now you will need to edit the email form Perl script file. Open Notepad (if you are using Windows Vista, you should right click on Notepad in the Windows Start menu and select ‘Run as Administrator') and browse to your site folder *

    5. Open 'MailForm.pl' and search for: -

    2377

    6. you should arrive at a line: -

    $sError = ACTINIC::GetPhrase(-1, 2377);

    7. Below this line you will see the code that constructs the mail text, insert the following code in the same place as you entered the drop down list on your contact us form, (e.g. if you have entered the drop down list below the email address field in the 'Contact Us Bulk Area', then locate the '$sEmailRecpt' entry and put it below that) :-

    $sTextMailBody .= "Drop Down title: " . $::g_InputHash{'dropdown1'} . "\r\n";

    8. Save and close the file and update your site.

    * Depending on the installation option chosen or operating system used, the 'Site' folder can be found in either 'My Documents', 'Documents', 'Shared Documents' or 'Program Files' in the folder 'Actinic vX\Sites\' (with X replacing the version number).

    Article and code supplied courtesy of Darren B of tametheweb.co.uk
Working...
X