Settings of MPForm << ^ MPForm Help pages ^
Frequently asked questions regarding MPForm
- Question: Website Baker already comes with the Form module, so why should I install MPForm?
- Answer:
You should install the MPForm module only if you reached the functional limit
of the Form module. MPForm offers much more potential,
but consequently it requires more effort to learn how to adjust all the settings appropriately.
- Question: My form contains a Date field. When I click the calendar icon next the field, no calendar does pop up?
- Answer:
The Javascript Calendar in some WB versions came with a known bug: If the Mainbody style uses
absolute positioning and a Z-Index, the Calendar is positioned behind instead of in front of
the main window.
You just need to adapt the screen.css file of your template and everything will work.
- Question: How can I integrate a declaration of consent (or my terms and conditions) into the form?
- Answer:
You can use a field of type HTML for arbitrary HTML code. When you put a single mandatory
checkbox beneath this field, the user can only submit the form after he agreed to your conditions.
- Question: Is it possible to preset a field dynamically, depending on some conditions?
- Answer:
Yes, you just need to set the right SESSION variable before the form is generated:
- Find out the ID of the field and the section_id of the form (look, for instance, into the field properties in the backend)
- Write your code in the file private.php into the function private_function_before_new_form.
For the field with ID 42 in the form of section 24 you would write e.g.
if ($section_id == 24) { $_SESSION['field42'] = "default value"; return true; }
In case you have a multi select field, you write:
$_SESSION['field42']=array('one','two'); - Question: I get a Fatal error: "Call to a member function numRows() on a non-object in \modules\mpform\evalform.php on line 533" - What does this mean?
- Answer:
You probably changed the suffix of the results table after you created the first field of the form.
Starting with version 1.2.x of mpform the problem should not occur anymore, but if you have changed
the suffix of the results table in an earlier version of mpform when already fields were present,
it should help to open the general settings page in the backend and simply save the settings again.
This should trigger a scan of the fields and update the results table accordingly.
- Question: When creating a new section it is always a div-based layout and I have to edit the settings each time. Can I permanently switch back to the old-style table based layout?
- Answer: Yes, you can permantently change the layout for freshly created sections by creating a file constants.user.php, where you can define the default layout. Have a look at constants.php to see which constants are used and define your own setting in constants.user.php.
- Question: When I export the submissions as csv file the deleted submissions are still there. What am I doing wrong?
- Answer:
This may have two reasons: Versions of MPForm before 1.3.1 did not store the submission_id
in the results table. When you open the general settings and save them again, the appropriate
column is added to the database. Subsequent submissions will track the submission_id
not only in the submissions table, but in the results table as well. If you delete them,
they will also vanish from the results table.
The other case are multi page forms: Even in new versions the line is not removed from the results table when a subsequent page has been submitted (which then has updated the submission_id in the results table, because it has added new data). - Question: But how can I get rid of all the old submissions then?
- Answer: The best way is to export the section (which includes the fields and settings but not the submissions). Next, you delete the whole section of the form. After that, you re-create a new MPForm section, and finally you re-import the previously exported settings. Then, your old submissions are gone.
- Question: I don't need the results table at all. Can I disable it?
- Answer: Yes, just set the suffix to the string "DISABLED", but be aware that export as csv file won't work, then.
- Question: How can I modify the appearance of my form?
- Antwort: As described in Table or div the field loop, which is executed to produce the output of the form, can be customized with quite some flexibility. In the loop the place holder {CLASSES} which contains CSS classes can be used. Those classes may be configured in the frontend.css file in order to influence the appearance. Since version 1.3.2 the place holder {TEMPLATE} may be used as well, and as soon as it is contained in the field loop, an additional input appears when creating or modifying fields, which lets you define what will be inserted instead of this place holder when rendering this particular field. In this replacement string, again the same place holders are allowed as in the field loop itself. Even without this template mechanism you can insert a few fields of type HTML, e.g. to force a line break in floating layouts. In addition, the fields themselves contain additional classes now, which allow a more flexible layout using CSS. Since version 1.3.3 the place holders {TEMPLATE1} ... {TEMPLATE9} are available, too, which contain the first to the nineth line of the field template. For fields whose local template contains less lines, the remaining place holders contain the empty string. When in the field loop or in the template the place holder {FORMATTED_FIELD} is used instead of {FIELD}, another input appears in the backend, where the user can define his own css classes explicitly for the current field.
- Question: I have configured notification mails. Can I configure mpform not to store any data in the database?
- Answer: In the settings for SPAM protection for
- Submissions stored in Database you can configure how many entries shall be stored in the database. If you set this to 0, no data is stored in the submissions table, nor in the results tables.
- Question: Can I enforce the user to actually select something in select boxes, radio button groups, or checkboxes?
- Answer: Yes, the field needs to be configured as a required input. The default value should be something like "please make your choice...". To prevent this value from actually being accepted as a valid input, you need to prepend the
- Value-Option Separator-String as configured in Special Settings. For this use case that separator string has to be the beginning of the value, which is preceeded so to say by an empty string. Therefore, if this option is selected, that empty string is returned, which in turn is not accepted as a valid choice since mpform version 1.3.15.
- Question: How can I ensure that a contact form just sends emails but does not store any data on the server side?
- Answer:
This is possible since version 1.3.19:
You just have to go to "general settings", "Workflow Settings" and remove all the content of the template in the box "Data transfer to mpform_submissions table" and save the settings. You also need to set the "name suffix for result table" to "DISABLED"
Alternatively, you can also go to "Advanced Settings" and in the section "SPAM Protection" set the "Submissions stored in Database" to 0 and save the advanced settings.
The first method stops saving submissions to the submission table of the current form, the second one has a larger impact, namely the next submission would wipe out all data in the submission_table and in the results_table if the suffix not already set to "DISABLED".