Live calculation form
Explore Form Fields and Formulas
Use the product, quantity, and sales-tax fields directly in the editor. The panel follows the document while conditional instructions update dependent values and table formulas recalculate the totals.
Calculation pipeline
The business rules travel with the document template.
AUTOMATIC
2Conditional instructionsSet dependent product values
3Table formulasCalculate subtotals and final values
Form fields0
Formula cells0
ValidationOff
Calculated table cells
Each result is read from the live document. Select a result to locate its formula cell in the order form.
READING
Reading formulas from the document...
Ready to tryUse the controls above to interact with this demo.
What this demonstrates
The document is the calculation model
The template combines Word-compatible form fields, conditional instructions, and spreadsheet-style table formulas. The application enables validation, but the field dependencies and arithmetic rules remain embedded in the document.
Validation engine
TXTextControl.setIsFormFieldValidationEnabled
Form model
TXTextControl.formFields
Form events
formFieldSelectionChanged / formFieldTextChanged
Formula inspection
TableCell.getFormula / getText
How it works
Two SelectionFormField objects store the available products and quantities, while a TextFormField stores the sales-tax rate. Users operate these fields directly in the editor, and the Try It panel reads the same document objects to reflect the current state.
setIsFormFieldValidationEnabled(true) activates the conditional instructions stored in the template. Whenever a referenced field changes, TX Text Control evaluates its conditions and applies their instructions to dependent form fields.
After the dependent values change, formulas embedded in the order table recalculate their cells. The panel walks through TXTextControl.tables, reads each TableCell.getFormula, and displays the corresponding TableCell.getText result.
TXTextControl.setIsFormFieldValidationEnabled(true, refreshModel, showError);
["formFieldSelectionChanged", "formFieldTextChanged"]
.forEach(eventName => {
TXTextControl.addEventListener(eventName, refreshModel);
});
const formula = await request(cell, "getFormula");
const result = await request(cell, "getText");
NuGet packages
TXTextControl.TextControl.Core.SDK
34.0.4
Provides the core document model and server-side document processing APIs.
dotnet add package TXTextControl.TextControl.Core.SDK --version 34.0.4
Provides the browser-based TX Text Control document editor and JavaScript API.
dotnet add package TXTextControl.Web --version 34.4.0
TXTextControl.Web.DocumentEditor.Backend
34.4.0
Hosts the WebSocket-based backend used by the browser document editor.
dotnet add package TXTextControl.Web.DocumentEditor.Backend --version 34.4.0