Add Custom Validation Street Address Field in backend Magento 2

You Can do it by Script and update validation within it.You have to change

'validate_rules' => '{"max_text_length":255,"min_text_length":5}',

You can change it directly from DB you have to do it carefully.

  • Open table eav_attribute and find attribute_code street and get attribute_id from it (generally attribute_id is 28).

enter image description here

  • Open table customer_eav_attribute and find that attribute_id (28 in my case). update in validate_rules column {"max_text_length":255,"min_text_length":5}

enter image description here

  • Now it is done in admin

    enter image description here

Note: You have to remove if it occurs in front


i am not sure if this works

<rule name="required-entry" xsi:type="boolean">true</rule>

Example from first name

<field name="city" formElement="input">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="source" xsi:type="string">address</item>
            </item>
        </argument>
        <settings>

remove this validation

            <validation>
                <rule name="required-entry" xsi:type="boolean">true</rule>
            </validation>

up to here

            <dataType>text</dataType>
        </settings>
    </field>