The Checkbox form field is used to enable or disable a specific
feature in a form. In the screenshot below, a checkbox
form field is used for option
Password never expires.
With a checkbox form field, you can associate form actions that are
executed when the form is submitted. The actions differ dependent on the
checkbox being check or unchecked. In most cases, the actions executed
for a checkbox is the Set
variable action when the
checkbox is checked.
To add an checkbox form
field field, activate the
form and select menu option Add form
field.... Select form field
type Checkbox
and press OK. The Configure form
field dialog box is shown.
Appearance - Text
Enter the text shown next to checkbox.
Initial state - Not checked
Select this option if the checkbox must have an unchecked state when the
form is loaded:
Initial state - Checked
Select this option if the checkbox must have a checked state when the form
is loaded:
Determined by variable
Select this option if you want the checkbox state to be determined by the
value of a variable (e.g. to show for a selected user whether the user
should change his password or not).
Unlike the options Initial state - Not checked,
and Initial state - checked, where the administrator predetermines the
initial state of a checkbox, it is also possible to use the value of a
variable to set the initial state of a checkbox.
Example
Suppose you want to create a two-step Wizard for resetting passwords. In
step 1, the user is selected from a generic table and in step 2 the "Password
never expires" checkbox needs to be displayed. The state of this
checkbox should reflect the "Password never expires" setting
for the selected user in Active Directory.
In this case, you would
need to create two forms. The first form will contain a generic table
with user data, including the values for the attribute userAccountControl
"Password never expires" which is either "Yes" or
"No". This value is then stored in the variable %NeverExpired%.
In the second form, a checkbox is inserted with the following properties:
If the variable %NeverExpires% holds the value "Yes"
for the selected user, the initial state of the checkbox will be checked. If %NeverExpires% is "No",
the initial state of the checkbox will be unchecked.
Note - the example
given above does not work for all the userAccountControl user flags. Property
flags such as PASSWORD_EXPIRED and DONT_EXPIRE_PASSWORD cannot be retrieved
using an LDAP query (it is possible to set the values for these attributes,
but not to retrieve them).
Configure actions when
form is submitted - Actions when checked
Press the Configure button to setup the actions that must be
executed when the form is submitted and the checkbox is checked. See Form action - General for more information
on form actions.
Configure actions when
form is submitted - Actions when unchecked
Press the Configure button to setup the actions that must be
executed when the form is submitted and the checkbox is unchecked. See
Form action - General for more
information on form actions.