Widget-Plugin: Google reCaptcha


The icon for widgets of type Google reCaptcha in Xima® Formcycle Designer.

7.0.13+ This plugin can only be used with Xima® Formcycle Version 7.0.12 or higher.

Plugin-Download (requires login)

Function description

Example of an inserted Google reCaptcha widget in a form.

The plugin provides a new widget in the designer, which allows to insert a Google reCaptcha in the form that the user must fill in correctly before submitting the form. The Google reCaptcha widget can be placed in any number of positions in the form.

Installation

The plugin can be installed as a client plugin or system plugin. Instructions on how to install plugins can be found here.

Configuration

The following properties can be configured on widgets of this type:

Basic properties

Basic settings for Basic properties

The basic properties name, width and hidden are available for all form elements.

This panel lets you configure basic properties such as the element's name and its width.

Elements can be repeated to allow the user to enter one or more data sets.

The number of times an element is repeated can be set via a trigger. In this example, the fieldset with the personal data of a person's child is repeated. The number of repetitions depends on the number of children the user has selected.
NameDescription
ElementYou can change an element's type via the drop down menu. For example, you could change a single input field into a multi line input field (textarea). The element types that are available depend on the original element type. Container and fieldsets cannot be changed into other form elements.
NameTechnical name of the elements. Only letters and numbers are allowed. The name is used, for example, to refer to the form field during workflow processing. To change the name and update the references to this form element at the same time the Rename form elements function   should be used.
AliasAn alternative technichal name that may contain any character.
WidthThe width of the form element, relative to other elements in the same row. For example, when you place three elements next to each other in the same row and set their widths to 10, 10 und 30, they will take up 20% (=10/(10+10+30)), 20%, and 60% of the entire width of the row, respectively.
HiddenWhen enabled, the form element is hidden and will not be visible to the user. If you wish to hide or show the element dynamically, depending on the value of another element, use the hidden if condition or a JavaScript function such as jQuery.fn.visible.
DisabledWhen enabled, the value of the form element cannot be edited. Also, the value will not be transmitted to the server when the user submits the form. For text input fields you can optionally decide whether you want to transmit the value when the form is submitted.
RepeatWhen enabled, the user can create an arbitrary amount of repetition (copies) of the element. This is useful, for example, when the user needs to enter one or more email addresses. Please note that repeated elements cannot be nested: A container or fieldset that is repeated cannot contain elements that are also repeated.
Min repetitionsMinimum number of repetition that must exist. When this limit is reached, the user cannot delete any more repetitions. This limit is also the initial number of repeated elements that are displayed when the form is opened for the first time.
Max repetitionsMaximumer of allowed repetitions. When this limit is reached, the user cannot add anymore more repetitions.
Repeat triggerWhen an element is selected, the value of that element determines how many repetitions are created. For example: A select element or input field lets the user enter the number of children they have. A fieldset with the personal data of a child is marked as repeated, and its trigger is set to the select or input field. Now, when the user changes the number of children, the appropriate number of fieldsets are created automatically.
Hide buttonsAvailable only when a repeat trigger was set. When enabled, the plus and minus buttons for adding and removing elements are hidden. This is useful when the number of repetitions should depend only on the value of another field and the user should not be able to alter the number of repetitions directly.

Alias

When a form is submitted, the entered data is transmitted as key value pairs (element name   value. The name must contain only letters and number. You can use the name of an element as form variables during workflow processing to refer to the transmitted values. The name is also used when sending the submitted data to other system via an interface. Sometimes, when you need to integrate external third-party system into FORMCYCLE, the external system may require a particular name for a form field, which may include special character. In this case, you can use the alias name, which allows all special characters to be entered.

When an alias was set, you can use that alias instead of the orignal name to refer to the form field.

Renaming form elements

If form elements are simply renamed, parts of the JavaScript or form workflow may no longer work correctly because they reference the form element by its name. By clicking on the pencil icon   next to the form element name, the form element can be renamed, updating all references to the form element at the same time. You can select where to search for references to the form element:

  • in the JavaScript area of the form
  • in the CSS area of the form
  • in JavaScript form files
  • in CSS form files
  • in the workflow of the form
  • for elements on the property "Value"
  • for elements on the property "Buttons"
  • for elements on the property "Options"

If a reference is found in the selected areas, it will be updated with the new name.

You need to pay special attention to JavaScript code. Common ways of referencing a form element are taken care of. The name in usual selectors such as $('[name="tfEmail"]') is replaced with the new name. However, uncommon selectors such as document.getElementByName("tfEmail") are not replaced.

Moreover, please note that it is not possible, even in principle, to replace all references in a complex programming language such as JavaScript. For example, the name may be be taken from a variable, from a computation or from an external data source: ["EMail", "Vorname", "Nachname"].forEach(name => $(`[name="tf${name}"]`).clear()). Such cases require you to adjust the JavaScript manually. If you have forms with complex JavaScript code, you should always evaluate the effects of renaming a form element beforehand.

This form elements does not possess any additional settings for the section Basic properties.

Style

Basic settings for Style

For Xima® Formcycle versions up to 6.3.2, the properties described here are still located in the Base properties section.

The properties available here are used to configure the visibility of the form element. The basic property Hidden is available to each form element. The properties Disabled and Repeat as well as the properties dependent on them are only available for form element types where they are useful.

User interface for changing basic properties of a form field, such as visibility, repeatability and whether the form element is disabled.

Elements can be repeated so that the user can enter as many data as desired.

The number of repetitions can also be set automatically, depending on the value of another element. In this example the fieldset with the data of a single child is repeated. There are always as many fieldsets as the number of children the user selected.
NameBeschreibung
hiddenWhen checked, the form field will be hidden initially. To show it again, the option visible if can be used, or a Javascript function such as  jQuery.fn.visible
disabledWhen checked, the content of the form field cannot be edited.
RepeatWhen this option is activated, the user can freely create any number of copies (repetitions) of this form element. For example, this can be used to let the user enter one or multiple email addresses. Please note that you cannot nest repeated elements: if a container is marked as repeated, none of its containing elements can be repeated.
Min. repeatMinimum number of allowed repetitions. When this limit is reached, the user cannot delete any more repeated elements. This is also the inital number of repetitions when the form is opened.
Max. repeatMaximum number of allowed repetitions. When this limit is reached, the user cannot add any more repeated elements.
Repeat triggerWhen an element is selected here: The number of repeated elements is automatically set to the value of the selected element. For example: Assume there is a select element or input element that lets the user enter number of children in their household. Also assume there is a fieldset for entering some data of these children. The fieldset is marked as repeated, and the select or input element is set as the repetition trigger. Now when the user enters how many children they have got, fieldsets are removed or created automatically so that there is always one fieldset for each child.
Hide buttonsAvailable only when an element was selected for Repeat trigger. Enable this option to hide the plus and minus buttons for adding and removing repeated elements. Use this option when the number of repeated elements should be controlled only by trigger.

This form elements does not possess any additional settings for the section Style.

Label

Basic settings for Label

This property defines the label text of an element. A label is the text above, below or to the right or left of an element. Not every element has got this property.

The label text appears next to a form element. It should be kept short and tell the user what they should enter in this form field.
NameBeschreibung
LabelValue of the label. This is the text that is displayed next to the element.
AlignmentSpecifies the position (left, right, above, below) of the label.
Width (in px)Distance between label and the element. Applies only when the alignment is set to left.
PlaceholderPlaceholder text, applies only to input fields.
TitleTooltip of the item (the HTML title attribute).
UnitText that after an element. Usually this is used for units, such EURO or km.

This form elements does not possess any additional settings for the section Label.

Constraints

Basic settings for Constraints

The constraints panel contains options to check the value of form fields, when form fields should be visible and when they can be edited. Some constraints are available only for some element, see the list of element..

Properties

A form field can be made a required field, requiring the user to enter something or select an option.
NameDescription
hidden ifHides the form fieldm when a certain conditions is satisfied.
visible ifMakes a form field that has been hidden visible again, when a certain condition is satisfied.
read-only ifLocks a form field and disallows any input, when a certain condition is satisfied.
editable ifMake a form field that has been set to read-only editable again, when a certain condition is satisfied.
requiredWhen this option is activated, a value must be entered for the form field. Conditions set under required if are ignored when this option is activated.
required ifMarks a form field as a required field, when a certain condition is satisfied.
required groupAvailable only when the form field is a required field. Specifies the required group the form field should belong to. When two or more form fields belong to the same group, at least one of these form fields needs to be filled out, all other fields may remain empty.
 
7.2.0+  When using a user-defined formula as a condition, this option has no function. No server-side validation can be performed in this case.

Condition

Any condition referring to the value of a select element uses the value of the option for testing the condition, as entered in the colum value.

You can change a form field's visibility and read-only state depending on the value of another form element.

7.2.0+ You can also choose formula, which lets you enter a custom formular with your own logic. That formula may reference more than one form element. Please note the following:

  • The formular must be a valid JavaScript expression, e.g. $("[name='tfFirstName']").val() === "John".
    • JavaScript statements cannot be used, e.g. var x = $("[name='tfFirstName']").val() ; x === "John" will not work.
    • If still necessary, you can wrap statements in an IIFE (immediately invoked function expression): (function(){var x = $("[name='tfFirstName']").val() ; return x === "John"})()
  • You can use form variables to access form values more easily. The variable is replaced with a JavaScript value container the value of the form element. For example: [%tfFirstName%]==="John"
    • If the value represents a valid floating point number, the placeholder is replaced with a JavaScript number value, e.g.: [%tf1%]+[%tf2%] < 10 (Sum of both fields < 10). Otherwise, the value is replaced with a JavaScript string, e.g.: [%tf1%].toUpperCase() === "JOHN" (Field equals "John", case insensitive).
    • The value depends on the type of form element:
      • For checkboxes, the value when checked is used, as entered in the form designer (default: on).
      • For input fields and text areas, the value as entered by the user is used.
      • For select elements displayed as combo boxes or list boxes, the technical value of the selected option is used.
      • For select elements displayed as checkboxes or radio buttons, the sum of all technical values of all selected options is used. This applies to select elements displayed as questions as well.
      • For upload elements, the file name of the selected fle is used.
      • For appointment pickers, the date and time as shown by the appoinment picker is used.
  • You can also use other variables such as system variables: e.g. [%$PROJECT_TITLE%] === "My form".
  • NO server validation is performed for custom formulas, even if that option is enabled for a form element.

Once you have selected a form element, the following conditions are available for the options hidden if, visible if, read-only if, editable if, and required if:

  • has a value
  • has no value
  • equals
  • not equals
  • lower than
  • lower equal than
  • greater than
  • greater equal than
  • between
  • regular expression

You can also select elements with the element picker to the right. Click on the hand-shaped icon and then on the element you would like to use. This comes in handy when editing forms with many form fields.

ConditionDescription
has a value / has no value

The conditions evaluates to true when the value of the form field is (not) empty.

In particular, having a value mean the following for different form elements:

  • for a checkbox, that the checkbox is not checked.
  • for a selection, that some option other than Please select an option has been selected. When the selection field is displayed as a combo box, the first option will be selected by default, unless the selection is a required field, in which case the option Please select an option will be selected by default.
  • for an input field, that at least one character has been entered.
equalsThe condition evaluates to true when the value of the form field equals the given value. Comparisons are case-sensitive.
not equalsThe condition evaluates to true when the value of the form field does not equal the given value. Comparisons are case-sensitive.
lower than / lower or equal thanThe condition evaluates to true when the value is lower (or equal) than the specified value.
greater than / greater or equal thanThe condition evaluates to true when the value is greater (or equal) than the specified value.
betweenThe condition evaluates to true when the value is between the specified range, inclusively. The interval must be entered with a dash (-), for example 2-10. Negative numbers must be enclosed in parentheses, eg. (-10) - (- 5).
regexpThe condition evaluates to true when the value matches the specified regexp.

Clear or reset automatically

For the properties hidden if and read-only if, you may choose whether the form field should be cleared or reset automatically when the form field ist hidden or disabled. Clearing a form field means that its value is removed, eg. deleting the entered text for an input field or unchecking all checkboxes for a select field. Resetting a form field, on the other hand, refers to changing its value back to the original or initial value it had when the form was openend. In case the form was opened for the first time and not submitted yet, the original value is the value as set in the Xima® Formcycle Designer. Otherwise, when the form was already submitted and is opened in the inbox, the original value is the most recently submitted (saved) value.

For example, consider the case of entering an address. The user can choose between a physical address and a post-office box, and only one input field is visible depending on the user's choice. When the form is submitted, a value should be send only for one of both fields. By selecting the empty automatically options, the input field post-office box will be cleared automatically when the user selects a physical address.

When an element is cleared or reset, all the elements it contains are cleared or reset as well. This applies to form elements of type page, container, and fieldset.

This form elements does not possess any additional settings for the section Constraints.

Help

Basic settings for Help

You can edit the help text that is shown as a tooltip. By default, there is no help text and no help icon.

The help text appears when hovering over the   icon with the mouse.

This feature allows you to add an explanation or help text to a form element. By default, the help text is empty. Once you enter a help text, you will see a help icon   appear next to the form element. When the user hovers over the help icon with the mouse, the help text is shown as an overlay. 

To change the design of the help icon or the overlay bubble, create your own CSS theme.

This form elements does not possess any additional settings for the section Help.

Options

Configuration of the reCaptcha keys via the designer.

The generated keys of the reCaptcha from Google

In the Options section, for the correct use of the Google reCaptcha widget, the website key and the secret key must be configured.
There are the following requirements for this:

  • registered Google account (login).
  • creation of the reCaptcha via Google (see)
  • At the created Google-reCaptcha go to settings and copy the created keys
  • Paste the created keys into the configuration fields of the designer

Version history

2.0.3

  • Fix: Captcha is no longer validated if submission button type does not require validation.
  • Requires Xima® Formcycle Version 7.0.11 or higher

2.0.2

  • Feature: new attribute data-name for hidden textarea.
  • Feature: widget can be used in condition properties in form designer

2.0.1

  • Fix: Adjustment to validation
  • Feature: addition of the attribute validate-blur

2.0.0

  • Feature: adaptations for Xima® Formcycle Version 7.