Deployment Guide

182 | Configuration Dell Networking W- ClearPassGuest 6.1 | Deployment Guide
See "Form Field Conversion Functions" on page 377 for a detailed list of the options available to you for the
Conversion and Value Format functions.
The Display Param is the name of a form field, the value of which will be passed to the Display Function. In almost
all cases this option should contain the name of the form field.
Display Arguments are available for use with a form field and are used to control the conversion process. In the case
of the expire_time form field, the Display Function is set to NwaDateFormat to perform a conversion from a UNIX
time to a date/time string, and the Display Argument specifies the format to use for the conversion.
See "Form Field Display Formatting Functions" on page 377 for a detailed list of the options available to you for the
Display Function and Static Display Function.
The Enable If and Visible If options in the form field editor allow you to specify JavaScript expressions. The result
obtained by evaluating these expressions is used to enable/disable, or show/hide the form field in real time, while an
operator is using the form.
Unlike the other parts of the form field editor, the Enable If and Visible If expressions are evaluated by the
operator’s Web browser. These expressions are not used by the server for any other purpose.
The expression must be a Boolean expression in the JavaScript language; statements and other code should not be
included as this will cause a syntax error when the form is displayed in a Web browser.
Because of the scoping rules of JavaScript, all of the user interface elements that make up the form are available as
variables in the local scope with the same name as the form field. Thus, to access the current value of a text field
named sample_field in a JavaScript expression, you would use the code sample_field.value.
Most user interface elements support the value property to retrieve the current value. For check boxes, however, use
the checked property to determine if the check box is currently selected.
The most practical use for this capability is to hide a form field until a certain value of some other related field has
been selected.
For example, the default create_user form has an Account Expiration drop-down list. One of the values in this list is
special: the -1 option displays the value Account expires at a specified time…
When this option is selected, the form expands to include the Expires After row, allowing the user to specify a time
other than one of the options in the list.
The expire_time field uses the JavaScript expression expire_after.value < 0 for the Visible If option. When the -1
option has been selected, this condition will become true and the field will be displayed.
If the expire_timezone field is used in conjunction with expire_time and a time zone and date are selected, the date
calculation is adjusted relative to the time zone.
Additional examples of the Visible If conditional expressions can be found in the guest_edit form.