ExpressionEngine Forms Module

This module lets you create your own custom (e-mail) forms in ExpressionEngine. By replacing the forms tag of the form in your template with the tag of this module it sends the form to the action you have selected or transforms it into a e-mail form based on the settings you have selected.

I've created this module because I want to have full flexibility when creating templates for a ExpressionEngine website.

E-mail

The contact form that ExpressionEngine provides is limited to a couple of basic fields. Almost every client likes to have some custom fields in their contact form. This module lets you create a form with as many fields as you want as it simply parses and sends the template that you selected to create a nice e-mail.

Example

Form

{exp:exp_forms:form name="contact"}
  Name:
  <input type="text" name="name" />

  E-mail:
  <input type="text" name="email" />

  Message:
  <textarea name="message"></textarea>

{/exp:exp_forms:form}

Template

<!DOCTYPE HTML>
<html>
<body>
  <h1>{title}</h1>
  <p>The following message has been sent:</p>
  <table>
    <tr>
      <td><strong>Name:</strong></td>
      <td>{name}</td>
    </tr>

    <tr>
      <td><strong>E-mail:</strong></td>
      <td>{from}</td>
    </tr>

    <tr>
      <td><strong>Message:</strong></td>
      <td>{message}</td>
    </tr>

  </table>

</body>
</html>

The {title} tag is based on the name that the form is given in the control panel

Action

Many times I've received templates from frontend developers with complete forms including things like javascript validation etc. The HTML that gets generated from built-in modules like the search form etc are somewhat different which sometimes breaks the layout or forces you to change classes in the css etc.

Creating a "Action form" lets you send your custom form to a build in action without having to lookup the action id.

Control panel

Before using the tag you have to create a form trough the settings page of the module. alt text

Options

E-mail

alt text

When using it as a e-mail form you have to enter the recipients and select a template that will be used as the e-mail.

Action

alt text

Module tag

Replace the <form> tag in your template with the module tag

{exp:exp_forms:form name=""}...{/exp:exp_forms:form}

Parameters

  • name
  • id
  • class
  • hidden_fields
  • secure
  • onsubmit