Forms, Bonuses and Smarty Templates

Forms, Bonuses and Smarty Templates

Configuring Forms

User-defined forms allow you to adjust particularly complex forms, such as the registration form, to the requirements of a specific panel in an optimal way.

EFS provides you with user-defined forms for registration, data changes, and profiles of community panels.

  • You can use different forms on different language versions of the same website.

  • For each language version, you can create and use several forms of the same type at the same time. Thus you can, for example, use different registration forms for different ways of entry.

  • Related variables can be assigned to a group and then output in a separate section of the registration form, for example.

In the following Chapters, you learn to manage user-defined forms:

  • It explaines how to manage the forms of a panel.

  • You learn to change the configuration of the variables used in a form.

  • It introduces special features of registration and data change forms.

  • You learn about the special features of profile forms.

Managing Forms

The GUI for creating and managing forms is located in the Website → Standard content → Forms menu.

 

Information

Read rights for “panel_website_forms” are needed for accessing the Forms menu.

If you want to view forms of another language version which you’re authorized to access in a given installation with several websites and/or language versions, simply change the settings in the upper section of the dialog. You can use the View function to change the number of table columns displayed as well as the number of rows per page. You can browse the overview table.

The following editing options are available:

  • Form name: Opens the overview of variables that belong to the respective form.

  • Edit settings: Opens the properties dialog.

  • Delete: The form will be deleted after a confirmation prompt.

Creating a Form

By clicking on the Create form button you can open the dialog used to configure a new form.

Form Properties

The table lists the properties a form can have.

Field

Description

Field

Description

Website / Language version

Website and language version to which the form belongs. Cannot be changed subsequently.

Form name

Name of the form

Description

Description for internal purposes only

Form type

The form type determines the function module where the form can be used.

You can choose from the following types

  • Registration: Available in the “Registration form” function module.

  • Changing data (logged-in panelists only): Available in the “Change data” function module.

  • Profile: Available in the “Profile search” function module.

Default form

Depending on the form type, the default form is either displayed on the “Registration” or “Change data” page, if they were created with EFS version 5.1 or earlier.

The default form’s “Additionally save in” option is used for the current language/use case when panelists register or change their data per Web service.

Configuring the Variables of a Form

Overview of Form Variables

To view the variables belonging to a form, click on the form name in the overview table. Alternatively, you can also click on the Edit variables button in the form’s properties dialog. This takes you to an overview table that lists the form’s variables along with their key properties.

Configuring Variables

If you wish to change an existing variable configuration, click on the Edit variable x in form y icon in the overview.

Creating a New Variable

If you wish to create a new variable, click on the Add variable icon in the overview.

Outputting Variable Characteristics in a Form

The order in which the variable characteristics are displayed in the form depends on the codes; it starts with the smallest available code. It is not possible to set a divergent order or define different language-dependent orders.

Special Features of Registration and Data Change Forms

Correct collection of registration data and their subsequent maintenance, in particular of panelists’ contact data, is essential for panel operation:

  • Collected data should be as accurate as possible.

  • Registration data should be stored in such a way that they are available later for processes in which they are necessary. Gender, for example, is often required for forming groups and should therefore be available as a master data item. Panelists’ first names, on the other hand, are not needed for forming groups and drawing samples, but are important for establishing contact: They should be stored as address data items.

The form types “Registration” and “Data change” provide you with great flexibility in adjusting the forms to the requirements of a specific panel:

  • As in the past, you can perform plausibility checks on data entered by candidates as soon as on entry. This reduces the risk of erroneous or deliberately false entry of important data, such as names and e-mail addresses. In EFS 6.0 you can define considerably more complex check expressions.

  • You can specify where the queried data are to be stored in the database. Contact data such as name, street and zip code are normally saved in the participant data table. Data that are important for panel operation later on, such as gender and age, are saved in the master data table. Optionally, you can also store data in both tables. (This may be advisable e.g. for “country”.)

  • From EFS 6.0 and later, you can convert the data upon saving. For example, you can merge the values of several variables into a single variable.

Configuration Options

The following table contains all possible configuration options.

Field

Description

Field

Description

Website / Language version

Website and language version to which the variable belongs. Cannot be changed subsequently.

Form name

This is determined when creating the form. Cannot be changed subsequently.

Form type

This is determined when creating the form. Cannot be changed subsequently.

Variable

The master data item or user variable which the form’s input field refers to.

  • Using the check expressions and transformation formulas described below, you can reformat the data entered, if necessary.

Label in form

The text used to label the form’s input field.

Exclude the following codes

You can hide certain answer characteristics of master data variables. To do so, enter the codes of the answer characteristics you wish to hide. The codes can be entered comma-separated or as a range (e.g. “1,2,3-10”).

Order

Order in which the input fields for the form’s different variables are output.

Group ID

The group ID is available in the templates and can therefore be used in many different ways, for example to group related form fields or to divide the form into different sections. If you assign the same group ID (e.g. 1) to several form fields, for example, you can output these fields next to instead of beneath each other (e.g. day, month und year for three related date fields). In doing so you can apply the label of the first grouped element to the whole line.

Check expression

You can enter a check expression, which is executed prior to saving of the data. If the check expression is correct, the data are not stored; instead, the specified error message is displayed.

  • Move the cursor over the ? icon to obtain an overview of available functions.

  • You can use the pseudo variable “self” to access the current variable.

Error message

Error message, which is displayed if the aforementioned check expression detects a problem.

Additionally save in

You can optionally save an entry in an additional master data item or user variable.

Only in the “Change data” form:

If the panelists use the “Change data” form, skip updating this variable if nothing was entered?

When using the form, panelists often only change a single variable and leave all the other input fields unchanged. By choosing this option you determine that only those values that were actually altered by the panelists will be added when they subsequently save their changes. Default setting: “Yes”.

Transformation formula for saving

You can enter a transformation formula, which is executed upon saving. This allows you to merge the values of several individual variables and store them in the current variable, for example.

  • Move the cursor over the ? icon to obtain an overview of available functions.

  • You can use the pseudo variable “self” to access the current variable.

Functions for Transformation Formulae and Check Expressions

You can use the following functions in transformation formulae and check expressions.

(cont.)

Function

Explanation

Parameter

Return value

Example

(cont.)

Function

Explanation

Parameter

Return value

Example

abs

abs (action: amount)

Returns the amount of a value without an algebraic sign.

$value: The value to be edited

Amount of the value without an algebraic sign

abs(self)

base64_decode

base64_decode (action: decode Base64)

Decodes the value using the Base64 algorithm.

$value: The value to be decoded

Base64 decoded value

 

base64_encode

base64_encode (action: encode Base64)

Encodes the value using the Base64 algorithm.

$value: The value to be decoded

Base64 decoded value

 

concat

concat (action: connect)

Connects two or more strings.

$string1 - $stringN: strings to be connected (an unlimited number of strings can be transferred)

concatenated strings

concat(self, u_firstname, md_0077)

get_date_diff

get_date_diff (action: difference between two dates)

Calculates the difference between two dates in days or years (rounded off).

$date1: first date, $date2: second date, $format: "d" (days), "y" (years)

Difference between two transferred dates

get_date_-diff('05.03.1982', '26.08.2008', 'y' ), get_date_-diff('1982-03-05', '26.08.2008', 'd' )

get_gmt_date

get_gmt_date (action: date in GMT)

Returns the current time (GMT) in the desired format.

$format: desired date format

Current, formatted date

get_gmt_- date('d.m.Y H:i:s')

get_timestamp

get_timestamp (action: date in timestamp)

Returns the Unix timestamp (number of seconds that have passed since January 11970 00:00:00 GMT) of the transferred date. Where no date has been transferred, the timestamp of the current date is returned.

$date (optional): date the timestamp of which is required

Unix timestamp

get_timestamp('13.04.2008'), get_timestamp('2008-04-13')

is_date_de

is_date_de (check: German date format)

Checks whether the transferred value is a date in German format (TT.MM.YYYY).

$value: Date to be checked

1, if German date, otherwise 0

is_date_de('05.03.1982')

is_date_int

is_date_int (check: int. date format)

Checks whether the transferred value is a date in international format (TT.MM.YYYY).

$value: Date to be checked

1, if international date, otherwise 0

is_date_de('05.03.1982')

is_email

is_email (check: valid e-mail format)

Checks whether the transferred value is a valid e-mail address format.

$value: E-mail address to be checked

1, if valid e-mail address, otherwise 0

is_email('mustermann
@questback.com')

is_float

is_float (check: floating-point number)

Checks whether the trasnferred value is a floating-point number.

$value: Value to be checked

1, if floatingpoint number, otherwise 0

is_float(10,5)

is_luhn

is_luhn (check: Luhn algorithm)

Checks whether the transferred value corresponds with the Luhn formula.

$value: Value to be checked

1, if Luhn algorithm, otherwise

0

is_luhn(10)

is_md5

is_md5 (check: md5 encoding)

Checks whether the transferred value was encoded using the md5 algorithm.

$value: Value to be checked

1, if md5- encoded, otherwise 0

is_md5('234mklksdf')

is_positive

is_positive (check: positive number)

Checks whether the transferred value is a positive number.

$value: Value to be checked

1, if positive number, otherwise 0

is_positive(5)

is_sha1

is_sha1 (check: SHA1 algorithm)

 

 

 

 

is_whole

is_whole (check: whole number)

 

 

 

 

length

length (action: return string length)

Returns the number of characters in a string.

$value: String to be checked

String length

length('test')

lowercase

lowercase (action: change to lower case)

Makes all characters in a string lower case.

$value: String to be changed

Changed string

lowercase('Test')

matches

matches (check: apply regular expression)

Checks whether a regular expression applies to a value

$regex: regular expression, $value: string to which the regular expression is applied

1, if regular expression applies, otherwise 0

matches('/^[a-f0-9]{32}$/','test');

md5

md5 (action: md5 encode)

Encodes the value using the md5 algorithm.

$value: Value to be encoded

Encoded value

md5('attack_at_dawn')

replace

replace (action: replace)

Searches the string for matches with regular expression and replaces them with "substitute".

$regex: regular expression, $replace: substitute $value: string

Edited string

replace('/^[a-f0-9]/','replace','7test12')

sha1

sha1 (action: encode SHA1)

Encodes the value using the SHA1 algorithm.

$value: Value to be encoded

Encoded value

sha1('attack_at_dawn')

substr

substr (action: return part of a string)

Returns the part of the string defined by the parameters start and length. If start is not negative, the returned string will commence at the string’s start position, beginning at 0.

$string: string, $start: beginning of the desired partial string $length (optional): length of the partial string

Partial string

substr('hello', 1, 1), returns 'e'

trim

trim (action: removes spaces at the start and the end)

Removes spaces at the start and end of a string.

$str: string, $charlist (optional): characters to be removed at the start and end of the string

Edited string

trim(' hello test ') results "hello test"

uppercase

lowercase (action: change to upper case)

Makes all characters in a string upper case.

$value: String to be changed

Changed string

uppercase('Test') results in "TEST"

when

when (query construction)

Checks whether an expression is true or not and returns the corresponding value.

$check: expression, $true: returned value (if expression is true), $false: returned value (if expression is false)

if $check is true, $true, otherwise $false

when('', 'true', 'false')

Nesting

Nesting can be used. If, for example, self = “testing”, the transformation formula yields uppercase(substr(self, 2, 3)) “st”.

Conjunctions

AND and OR can be used. If, for example, you enter a string that is not encrypted with MD5 or SHA1, the check expression

!is_md5(self) AND !is_sha1(self)

will yield an error. If the transferred string were encrypted with MD5 or SHA1, this expression would be false.

!is_positive(self) OR !is_date_de(self)

will yield no error only if both conditions are given, i.e., a positive number and a German date have been entered.

Example: Variables in the Standard Panel’s Forms

The following table lists the variables queried in the standard panel upon registration and changing of data.

 

Variable

Description

Order

Group ID

Check expression

Error message

Form „Registration“

Form „Change data“

Variable

Description

Order

Group ID

Check expression

Error message

Form „Registration“

Form „Change data“

u_account

Panelist's login name

1

 

 

 

X

X

u_firstname

First name

2

 

!matches('/ [^\s]/ ',request.u_firstname)

Please enter your first name.

X

X

u_name

Name

3

 

!matches('/ [^\s]/ ',request.u_name)

Please enter your last name.

X

X

u_street

Street

4

 

!matches('/[^\s]/ ',request.u_street)

Please enter your street name.

X

X

u_zip

Zip code

5

 

!matches('/^\s*\d{5}\s*$/ ',request.u_zip)

Please enter your zip code.

X

X

u_city

City

6

 

!matches('/[^\s]/ ',request.u_city)

Please enter your city name.

X

© 2024 Tivian XI GmbH