InternalPreChatField

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

Inheritors

Constructors

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

Properties

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
open override var isEditable: Boolean

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
open override val labels: PreChatLabels

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

Link copied to clipboard
open override val maxLength: Int

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

Link copied to clipboard
open override val name: String

The programmatic name identifying this field in the deployment configuration.

Link copied to clipboard
open override val order: Int

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

Link copied to clipboard
open override val required: Boolean

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

Link copied to clipboard
open override val type: PreChatFieldType

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).