Overview

The Entityform module allows the creation of front-end forms that are fieldable entities. The forms use the Field API.

Entityforms can be used when you need your form submissions to be entities and the fields on the forms to be standard Drupal Fields.

Adding Fields to Entityforms is done with same process as fields to Node content types. For more information on adding fields see the Field UI documentation.

Installation

Once you activate the module it sets up an Entityform administration interface under
Administration > Structure > Entityform Types

Usage

  • Enable the module

  • Go to admin/structure/entityform_types

  • You will notice that this page has four tabs across the top of the page. (By default, the List tab will be active). The four tabs are:

While you can define rules in this module via the Access, Submission, and Validation tabs, all of those rules that are implemented and managed by the Rules module. Nodeone has an excellent and free videos series entitled Learn the Rules Framework, which may help you learn the basic of the Rules module.

List

This tab will automatically list any existing Entityform types. In addition, you can also perform the following task from this page:

  • Add a new Entityform type.
  • Edit an existing Entityform.
  • Manage the fields on an existing Entityform.
  • Manage the display of an existing Entityform.
  • Clone an existing Entityform.
  • Delete an existing Entityform.
  • Export an existing Entityform.
  • Import an Entityform type from a previously exported Entityform.
  • List the existing submissions for an Entityform type.
  • Submits an existing Entityform type for processing.

Ok, let's add a new Entityform type (or you can edit an existing Entityform type). To do this, we will need to be in the List tab.

  1. Click "Add an Entityform Type" to add a new Entityform or click on "edit" to edit an existing form. The Add (or edit) entityform form will appear. You will notice there are at least four tabs across the top (there may be more depending upon which other modules you have enabled):
  2. A new window will appear. Please enter the requested information. Should you need additional information, you can read the user documentation. It provides instructions for each field on the "Add an Entityform Type" form.

    CRITICAL NOTE: The permission for the different Entityforms are not contained on the Admin >> People >> Permissions page! Rather, the permissions for each Entityform are contained in the vertical tab labeled Access Settings. You must make sure that you have at least checked one role that can submit the form.

  3. Click "Save Entityform Type" Once the Entityform Type has been saved, you will be presented with the Manage Fields form.

  4. The standard Drupal 7 Manage Fields form will be presented to you. You will use this form to add fields to the Entityform you created in the above steps. You will add fields to this Entityform just like you do when you are adding fields to any other entity type, such as article, basic page, user, comment, or taxonomy term. (This is due to the fact that an Entityform is an entity - just like Content (node), User, Comment, or Taxonomy Terms.)

  5. Once you have added your fields, you might want to click on the Manage Display tab so you can specify how your fields will be displayed. Before leaving the Manage Fields screen, make sure you save all of the changes that you entered for all of your fields. To exit the current form, you can click on the X, which is inside of a circle. This X is located at the top right corner of the current form.

  6. To view your form, you will need to return to the list of Entityform Types. You can do this by going to Administration >> Structure >> Entityform Types. To see the Entityform you just created, click on the "Submit Link" button that is on the same line as the desired Entityform.

Access Rules

This tab allows you to create access rules that control under what conditions a user can “see” the form. Please note the basic entity form page with the instructions will be displayed no matter what, however actual Entityform itself will be hidden if the access rule conditions are not met.

Please note that this page only allows us to define access rules. It does not allow us to assign these rules to a specific Entityform. We will use the Access setting vertical tab on the individual Entityform to assign a specific access setting rule to the specific form.

You can add your own access rules as needed.

Submission Rules

The Submission rules enable us to specify under what conditions the Entityform can be submitted to the system and what to do once it has been submitted.

For example, default Email Entityform submitter rule specifies that an anonymous user can not submit the Entityform. If an authenticated user submits an Entityform then the system will send an Email with the contents of the Entityforms to the appropriate Email address. The default Email address in the one specified in the e-mail address field on the Home » Administration » Configuration » System page.

Please note that this page only allows us to define Submission rules. It does not allow us to assign these rules to a specific Entityform. We will use the Submission setting vertical tab on the individual Entityform to select the appropriate submission rule for the specific form.

You can add your own submission rules as needed.

Validation Rules

The validation rules enable us to specify under what conditions the Entityform will be considered valid. If an Entityform does not pass validation an error message will be displayed to the user and the form will not be accepted.

No default validation rules are supplied. Therefore, you will need to add your own validation rules.

Please note that this page only allows us to define validation rules. It does not allow assigning these rules to a specific entity form. We will use the Validation settings vertical tab on the individual entity form to select the appropriate validation rules for the specific form.

Comments

jetwodru’s picture

default Email Entityform submitter rule specifies that an anonymous user can not submit the Entityform.

The above statement sounds incorrect. From my understanding and testing, Submission Rules = EntityForm had already been saved, NOT BEFORE saving. Hence the EntityForm had already been submitted irrespective of the conditions in Submission rules. The Email EntityForm Submitter rule only verifies if an email notification will be sent to the submitter, NOT disallowing the submission.

tedbow’s picture

You are correct.

nithinkolekar’s picture

Validation Rules, Form Access Rules, Entityform Submission Rules are visible only when entity_rules is enabled. As of 2.x release , these are available under separate rules tab for each entityform edit page.

DieterAtWork’s picture

Even with entity_rules enabled, I don't get such tab anywhere. Are there other modules that needs to be enabled?

nithinkolekar’s picture

Fortunately I had two site running entityform one having rule tab at entityform's edit tab. I started roll backed modules to exact version of the other site. I seems nothing worked until I came to know that Entityforms Notifications module has to be enabled at least once although it is not required(dependent). It is a strange behavior for now but not critical one.

@tedbow
I don't think separate issue is required for this?
To reproduce this issue disable both Entityforms Notifications, entity rules and then also uninstall(soft) it. After that, just enable entity rule and you wont see any rule tab at entityform configuration until you enable Entityforms Notifications module.

gambry’s picture

After enabling Entity Rules and Entityforms Notifications tabs still don't show up on admin/structure/entityform_types.
And indeed paths are not even registered on the menu_router table. :(

gioadelu’s picture

Hi,
can I close the submissions automatically on the date set in a date field?
Maybe I have to create an access rule..

jesse_’s picture

Is it possible to reference another entityform type and use IEF to create entries of the referenced type on the go (while creating entries of the main type )?

Best,

mahfuznz’s picture

Hi,

I am trying change the items of a select list field dynamically using hook_form_alter which is saved all right, but when I open the submission in edit mode, I can't show the saved option selected in the list. I was thinking how can I distinguish between first submit and edit in hook_form_alter and then when it's edit mode I need to get the selected value from somewhere (I don't know) and set it as the default field for the select list.

I would appreciate if anyone can help me out with this.

Many thanks,

Mahfuz