Conditional validation
Validate the payment form
Choose a payment method and complete the fields it enables. Validation follows the conditional instructions stored in the document.
Rule-aware formValidate active requirements
The selected payment method determines which fields are currently required.
RULES
1Complete the form
Choose a payment method and enter the values requested by the document.
2Evaluate instructions
Run the document's conditional validation rules.
Ready to tryUse the controls above to interact with this demo.
What this demonstrates
Validate conditional form instructions
Conditional instructions connect form fields with logical rules. Complete the payment form and validate it to see whether all currently required values have been supplied.
API used
TXDocumentViewer.forms.validate
Key members
Conditional form instructions are evaluated by the viewer so the application can report missing values without duplicating the rule engine.
TXDocumentViewer.forms.validate(result => {
showValidationResult(result);
});
How it works
The Razor helper prepares the browser viewer and its document. Demo-specific JavaScript uses the public TXDocumentViewer API and remains encapsulated with this demo.
NuGet packages
Displays supported document and PDF formats in the browser.
dotnet add package TXTextControl.Web.DocumentViewer --version 34.2.0
Source files
See the implementation
The view, browser behavior, assets, and controller are encapsulated in Demos/DocumentViewer/FormFields/ConditionalInstructions.