Personal tools
You are here: Home Documentation Tutorials PloneFormGen Recipies Contact Form
Document Actions

Contact Form

A simple contact form, with a few bells and whistles.

Time to Build: 15 Minutes

View a working example of this form

If you need a primer on the basics of PloneFormGen, read this tutorial first, from ONE/Northwest

An organization-wide contact form is the most essential web form for any website. It's all fine and good to have a staff page with everyone's email listed there, but we know that spam can become a problem. An easy alternative is to create a contact form which allows the site visitor to select which person they wish to contact.

Ingredients

  • String Field for email
  • Selection Field for choosing the person to contact
  • Textarea field 
  • Mailer Adapter
  • Thank You Adapter

 

Steps

Create a Form Folder - PloneFormGen should give you an Email, Subject, and Comments field by default.

Create a Selection Field for the choices of people to contact. Each person's email should be a single line in the Options box. You can use the value|label method to hide the actual email address and only show a list of names instead. It's up to you if you like radio buttons or a drop-down menu better.

value-label.gif   Example of the value|label method

Rearrange the fields in whatever order makes the most sense. Remember that this can be done via the Contents tab.

Edit the Mailer Adapter. Go to the Overrides tab and notice the Recipient Expression field. You need to paste the following line of code in that field

request/form/short-name-of-selection-field

Where "short-name-of-selection-field" matches the short name of your Selection Field (the shortname should be the Title, all lowercase, with hyphens instead of spaces).

Edit the Thank You Adapter to include the message you want the form submitter to see. You can also choose to display the field data or not.


 
by samk last modified 2009-04-01 09:23 All content on this site is licensed under a Creative Commons License.
Still Stumped?
If you've still got questions about Plone, here are your best bets for finding out more:
 

All content in this site distributed under the Creative Commons "Attribution-NonCommercial-ShareAlike" license unless otherwise noted.

Powered by Plone CMS, the Open Source Content Management System