TextFormFieldType enumeration

TextFormFieldType enumeration

Specifies the type of a text form field.

Members

NameDescription
REGULARThe text form field can contain any text.
NUMBERThe text form field can contain only numbers.
DATEThe text form field can contain only a valid date value.
CURRENT_DATEThe text form field value is the current date when the field is updated.
CURRENT_TIMEThe text form field value is the current time when the field is updated.
CALCULATEDThe text form field value is calculated from the expression specified in the FormField.text_input_default property.

Examples

Shows how to create form fields.

builder = aw.DocumentBuilder()
# Form fields are objects in the document that the user can interact with by being prompted to enter values.
# We can create them using a document builder, and below are two ways of doing so.
# 1 -  Basic text input:
builder.insert_text_input('My text input', aw.fields.TextFormFieldType.REGULAR, '', 'Enter your name here', 30)
# 2 -  Combo box with prompt text, and a range of possible values:
items = ['-- Select your favorite footwear --', 'Sneakers', 'Oxfords', 'Flip-flops', 'Other']
builder.insert_paragraph()
builder.insert_combo_box('My combo box', items, 0)
builder.document.save(file_name=ARTIFACTS_DIR + 'DocumentBuilder.CreateForm.docx')

See Also