0

Is it possible to get the minimum text length value from store config system.xml?

<field name="mytext" sortOrder="20" formElement="input">
    <argument name="data" xsi:type="array">
        <item name="config" xsi:type="array">
            <item name="source" xsi:type="string">customer</item>
        </item>
    </argument>
    <settings>
        <label translate="true">MyText</label>
        <dataType>text</dataType>
        <dataScope>mytext</dataScope>
        <validation>
            <rule name="required-entry" xsi:type="boolean">true</rule>
            <rule name="min_text_length" xsi:type="number">_____value from store config_____</rule>
        </validation>
    </settings>
</field>

1 Answer 1

0
<field id="show_items" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
                <label>Default Items to Display</label>
                <validate>validate-number validate-digits validate-greater-than-zero no-whitespace validate-length maximum-length-3</validate>
                <comment>Maximum 999</comment>
            </field>

this is how you can validate your field in system.xml for more validations you may refer to this link Validation in Configuration

1
  • Sorry, that is not what I was asking. Can you use field from system.xml config for validation in customer_form.xml ui-component?
    – user59268
    Commented Nov 15, 2019 at 5:05

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.