Form
Forms collects one or multiple user input, that replaces placeholders in the phrase contents.
Example: This phrase example contains static text and three form macro place holders:
If you trigger such phrase, PhraseExpress would scan the phrase for all form macros first and render a form which prompts for input:
After filling the form, PhraseExpress replaces the form macro place holders in the phrase contents with the user input and outputs the phrase:
Customer Name: Mike
The customer is an existing customer.
The customer is using version 14.
Above is the simplest example to illustrate forms. PhraseExpress additionally allows you to perform calculations with the user input, check for syntax (e.g., correct format if prompting for an email address), perform "If-then-Else" queries or save the input into variables for use in other phrases (Video tutorial).
Form macros are an exception to the normal sequential macro processing as they are processed before any other phrase content.
How to create a form:
- Open the main program window.
- Select the phrase, you wish to extend with additional user input.
- Place the cursor at the position in the phrase where you wish to insert user input and select
: - Configure the form macro.
- Repeat from step 2 for all desired user inputs.
Appearance
This macro function specifies the form window title text, font size, width and height:
You can also specify if the the form output preview is shown automatically with the form.
Form input
The form input provides multiple different types of input controls, such as text input, check boxes, radio buttons, drop-down menus or tables.
Text input
The single- or multi-line text input replaces the macro placeholder in the phrase.
PhraseExpress can optionally prevent input mistakes by checking the syntax (e.g. URL, email address, file path, numbers, letters, etc.).
Drop-Down
The drop-down form input control allows users to select a single out of multiple options in a form:
After filling out the form, the output associated with the selection is replaced with the macro placeholder.
Macro input dialog:
- The defines the text above the drop-down input control in the form.
- The pre-selects one of the items, specified by its . If the extra option " " is checked, the last user selection will be pre-selected if you call the form multiple times.
- Enabling option " " allows users custom input next to the pre-defined options.
- PhraseExpress can also perform a Syntax check to prevent typing errors.
The section
lists all selectable options in the drop-down menu which are represented by the- contains the actual output into the phrase for the selected option.
- If required, PhraseExpress can of this form element, e.g. store the output into a variable, save it into a file, strip or replace characters, etc.
The Plus button or hotkey CTRL - N adds additional items. The reycle bin, ...yes it does what you think it does.
Click the pencil edit button to add macros to the description and/or output values.
Beginning with PhraseExpress v15, the output for each option must be defined. These are no longer automatically taken from the description of a selection option, as it may eventually be intended that no output should be given.
Checkbox
PhraseExpress outputs the content as specified for the ticked or unticked checkbox.
Checkbox group
Outputs the content as specified for ticked or unticked checkboxes. The output for each checkbox of group is enumerated with the specified enumeration text. The last two outputs are concatened by the corresponding enumeration text as specified.
The option "
" arranges the check boxes horizontally.Checkbox Dropdown
Checkbox Drop down menus offer you to select multiple items while saving vertical space in the form.
Disadvantage: You need to click the drop-down menu first to access the options.
Radio button group
Radio buttons allow you to make one single choice out of multiple options.
Option "
" arranges the radio buttons horizontally.Input Grid
An input grid adds a table, consisting of multiple input types.
After filling out the form, the outputs associated with the selected column elements are replaced with the macro placeholder. If several options are selected, the output will be enumerated with the defined separator and the final last separator. The individual lines will be separated with the defined line separator.
Single-line input
Multi-line input
Checkbox
Radio button
Dynamic forms
Form input elements can be shown depending on the input of another form input of the same form.
To control, visibility of a form input element, check option "
" and select the user input, that shall control the visibility:Phrase Dropdown
This form input element allows you to select a phrase from the defined phrase folder that is identified by its autotext.
Date input
This form element adds a date input field with calendar window to the form:
Numeric slider
This macro function adds a slider for number input:
Numeric input
This macro function adds a numeric input box to a form:
Form group
This macro function groups a set of form elements and outputs the user input by customizable enumerators:
The example creates a group of 3 checkboxes. The checked items will be separated by ", ". The last checked item will be separated by " and ".
Output examples:
ear, nose and mouth
ear and nose
Text label
This macro function adds a text label to the form:
You can also specify a clickable link.
The form text label is not output into the phrase.
Separator
This macro function inserts a horizontal line to visually separate form contents:
WYSIWYG forms
WYSIWYG forms allow you to place text input boxes, dropdowns, phrase selection dropdowns, checkboxes and date selection within a formatted phrase:
Any form input is inserted the actual position of the input control.
WYSIWYG form elements cannot be mixed with other PhraseExpress macro functions. Use the alternative form elements as described above if you need to process form input with other macro functions.