Defining a Dynamic Minimum Value for an Input Field
Question
> I want to ensure that Attribute B is always at least a certain amount greater than Attribute A. K3 does not support a direct dynamic minimum value for this—how can I still enforce this?
Answer
K3 currently does not allow direct dynamic minimum values for input fields. However, you can implement the desired behavior as a workaround using a hidden calculated attribute: As soon as the user enters an invalid value, the hidden attribute falls below its own minimum value—the configurator marks the field as invalid and prevents submission.
Implementation
Assume that Feature B must always be at least X greater than Feature A.
- Create a hidden numeric feature: Create a new one, ausgeblendetes Zahlenmerkmal, e.g., “Distance Check”
- Set the minimum value: Enter
0as the minimum value - Define the formula: Define the following Berechnungsformel:
MerkmalB - MerkmalA - X
Replace MerkmalA, MerkmalB, and X with your actual attribute names and the desired minimum distance.
How does this work?
- As long as B − A ≥ X, the result is ≥ 0 → no error
- As soon as B − A < X, the result becomes negative → falls below the minimum value of 0 → the configurator displays a validation error and prevents submission
The sash height must be at least 60 mm greater than the window height:
- Feature A =
Fensterhöhe, Feature B =Flügelhöhe, X =60 - Formula:
Flügelhöhe - Fensterhöhe - 60 - Minimum value of the hidden feature:
0
Further Information
- Wie lasse ich etwas berechnen? – Calculated Features and Formulas
- Merkmale ausblenden – Showing and hiding characteristics based on rules
Related Topics
- Input validation
- Dependent numeric values
- Calculated characteristic as a constraint