Online Sample: Combining Form Fields and Formulas
Using conditional instructions, it is possible to add dependencies between fields based on logical operators. This allows to add a complete workflow to forms by adding dependencies between form fields. This article illustrates how to combine form fields with table cell formulas.

Form fields provide a very powerful feature to control the behavior and workflow of inserted fields such as checkboxes, drop-downs and date picker fields. These Conditional Instructions add dependencies between fields based on logical operators.
Text Control Technical Demos
Test this live in our online demos.
Combining Instructions and Formulas
The following animated screenshot shows such a condition. If the user changes the selected product in the drop-down form field, the description and the unit price is changing:
Dynamic Form Fields
The first condition product selection is shown in the next screenshot. If the selected item is Product 1, then the product description, the default quantity and the unit price is set dynamically. The screenshot shows the out-of-the-box dialog that can be used to create these instructions.
Combining with Formulas
The next screenshot shows the cell (circled in green) and the corresponding formula (circled in red) to calculate the line total. Essentially, the formula multiplies the quantity with the unit price:
As you can see in the screenshot, the line total table cell is a form field. This form field value can be changed by a formula and formulas can use form field values to calculate the results. In other words: Both elements can be combined.
The following instruction sets the tax percentage value in case the checkbox Sales tax is checked:
The formula for this calculation is circled in red. Because the cell value type is percentage, we only need to multiply the total line value with the sales tax value that has been set dynamically using the form field conditions:
Finally, the total amount is calculated by adding up the tax value and the line total.
Text Control Technical Demos
Test this live in our online demos.
ASP.NET
Integrate document processing into your applications to create documents such as PDFs and MS Word documents, including client-side document editing, viewing, and electronic signatures.
- Angular
- Blazor
- React
- JavaScript
- ASP.NET MVC, ASP.NET Core, and WebForms
Related Posts
How to Import and Read Form Fields from DOCX Documents in .NET on Linux
Learn how to import and read form fields from DOCX documents in .NET on Linux using TX Text Control. This article provides a step-by-step guide to help you get started with form fields in TX Text…
ASP.NETASP.NET CoreForm Fields
Create Fillable PDF Forms in .NET C#
This article shows how to create fillable PDF forms in .NET C# using the TX Text Control .NET Server component. The created forms can be filled out using Adobe Reader or any other PDF viewer that…
ASP.NETASP.NET CoreForm Fields
Extension Method: Flatten Forms Fields in PDF Documents using .NET C#
This article shows how to flatten form fields in TX Text Control before exporting the document to PDF. This is a common requirement when documents should be shared with others and the form fields…
Form Field Compatibility: Work with AcroForms, Legacy MS Word Forms, and…
This article shows how to work with form fields in TX Text Control and how they are compatible with other industry standards. It explains how to load and save AcroForms, legacy MS Word forms and…
Document Viewer: Save the Values of Form Fields in Documents
The TX Text Control Document Viewer is used to allow users to fill in form fields in documents. This article explains how to save a document with the values of the filled in form fields.