How to add digits range validation rule to the input field inside the UI-form?

1 Answer 1


In case you needed a digits range validation you should pass a range inside the rule's body as a --separated string, like this:

<field name="day" formElement="input">
        <label translate="true">Day</label>
            <rule name="validate-number" xsi:type="boolean">true</rule>
            <rule name="validate-digits-range" xsi:type="string">1-31</rule>

which leads to the error The value is not within the specified range. when value less or greater than specified in the rule's body.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.