com.aspose.words

Class TextFormFieldType

  • java.lang.Object
    • com.aspose.words.TextFormFieldType
public class TextFormFieldType 
extends java.lang.Object

Utility class containing constants. Specifies the type of a text form field.

Example:

Shows how to create form fields.
DocumentBuilder builder = new 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", TextFormFieldType.REGULAR,
        "", "Enter your name here", 30);

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

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

builder.getDocument().save(getArtifactsDir() + "DocumentBuilder.CreateForm.docx");

Field Summary
static final intREGULAR = 0
The text form field can contain any text.
static final intNUMBER = 1
The text form field can contain only numbers.
static final intDATE = 2
The text form field can contain only a valid date value.
static final intCURRENT_DATE = 3
The text form field value is the current date when the field is updated.
static final intCURRENT_TIME = 4
The text form field value is the current time when the field is updated.
static final intCALCULATED = 5
The text form field value is calculated from the expression specified in the FormField.TextInputDefault property.
 

    • Field Detail

      • REGULAR = 0

        public static final int REGULAR
        The text form field can contain any text.
      • NUMBER = 1

        public static final int NUMBER
        The text form field can contain only numbers.
      • DATE = 2

        public static final int DATE
        The text form field can contain only a valid date value.
      • CURRENT_DATE = 3

        public static final int CURRENT_DATE
        The text form field value is the current date when the field is updated.
      • CURRENT_TIME = 4

        public static final int CURRENT_TIME
        The text form field value is the current time when the field is updated.
      • CALCULATED = 5

        public static final int CALCULATED
        The text form field value is calculated from the expression specified in the FormField.TextInputDefault property.