Previous Topic: How to Create Dependent fields Using Select Box Data

Next Topic: Use Logical Attribute Handlers For Field Options


Use JavaScript For Field Options

You can specify the options that appear in fields on a profile screen by writing custom JavaScript.

To use a JavaScript to populate field options

  1. Modify a profile screen.
  2. Select a field to modify or add a new field.
  3. If you are adding a new field, select the attribute that is associated with the field from the list box.
  4. Select one of the following styles:

    The fields in the Field Properties dialog change based on the style selection you make.

  5. Select JavaScript in the Source of Selection Options field.

    An additional field, Selection Options (JavaScript), appears.

  6. Enter JavaScript to provide the options for the field in the Selection Options (JavaScript) field.

    The JavaScript you enter must contain a function with the signature "function getOptions(FieldContext)" and return a pipe delimited string of options. If the option has separate display and storage values, enter as "storage-value;display-value"

    For example:

    function getOptions(FieldContext) {
    
      return "1;one|2;two|3;three|4;four";
    
    }
    
  7. Specify one of the following values in the Preserve Non-Options field:
  8. Specify values for the remaining required fields.

    Note: For information on required fields, see the User Console online help.

  9. Click Apply, then click OK.

CA IdentityMinder saves the current field properties