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.
CurrentDateThe text form field value is the current date when the field is updated.
CurrentTimeThe 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.textInputDefault property.

Examples

Shows how to create form fields.

let builder = new 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.insertTextInput("My text input", aw.Fields.TextFormFieldType.Regular, 
  "", "Enter your name here", 30);

// 2 -  Combo box with prompt text, and a range of possible values:
let items =
[
  "-- Select your favorite footwear --", "Sneakers", "Oxfords", "Flip-flops", "Other"
];

builder.insertParagraph();
builder.insertComboBox("My combo box", items, 0);

builder.document.save(base.artifactsDir + "DocumentBuilder.CreateForm.docx");

See Also