InternalChoiceListField

class InternalChoiceListField(name: String, order: Int, labels: PreChatLabels, type: PreChatFieldType = PreChatFieldType.ChoiceList, required: Boolean, maxLength: Int, val choiceListId: String, userInput: String = "", errorType: PreChatErrorType = PreChatErrorType.None, isHidden: Boolean = false, isEditable: Boolean = true, var choiceList: ChoiceList = ChoiceList(choiceListId)) : ChoiceListField, InternalPreChatField

A pre-chat form field backed by a ChoiceList, allowing users to select from predefined options.

Constructors

Link copied to clipboard
constructor(name: String, order: Int, labels: PreChatLabels, type: PreChatFieldType = PreChatFieldType.ChoiceList, required: Boolean, maxLength: Int, choiceListId: String, userInput: String = "", errorType: PreChatErrorType = PreChatErrorType.None, isHidden: Boolean = false, isEditable: Boolean = true, choiceList: ChoiceList = ChoiceList(choiceListId))
constructor(preChatField: PreChatField, choiceListId: String, choiceList: ChoiceList)

Properties

Link copied to clipboard
open override var choiceList: ChoiceList

The associated ChoiceList for the pre-chat field.

Link copied to clipboard
open override val choiceListId: String

The choice list ID, which maps to a particular choice list on the ChoiceListConfiguration.

Link copied to clipboard
open override var errorType: PreChatErrorType

The current validation error for this field, or PreChatErrorType.None if valid.

Link copied to clipboard

Whether the user can modify this field. Non-editable fields display a pre-filled value.

Link copied to clipboard
open override var isHidden: Boolean

Whether this field is hidden from the user. Hidden fields can still carry default values.

Link copied to clipboard

The localized label strings displayed to the user for this field.

Link copied to clipboard
open val maxLength: Int

The maximum number of characters allowed for this field's input.

Link copied to clipboard
open val name: String

The programmatic name identifying this field in the deployment configuration.

Link copied to clipboard
open val order: Int

The display order of this field within the pre-chat form (lower values appear first).

Link copied to clipboard
open val required: Boolean

Whether this field must be filled before the form can be submitted.

Link copied to clipboard

The input type of this field, which determines validation rules and keyboard behavior.

Link copied to clipboard
open override var userInput: String

The current user-provided value for this field. Set this to populate the field.

Functions

Link copied to clipboard
open override fun isValid(): Boolean

Returns true if the current userInput passes all validation rules for this field.

Link copied to clipboard
open override fun validate(): PreChatErrorType

Validates the current userInput against this field's rules (required, format, max length).