For the checkout screen (custom OneStepCheckout plugin) I managed to succesfully add a custom validation rule on the second street input. Now I'd like to do the same for the default Address Book pages, but I can't seem to figure out where.

The custom rule "housenumber" has been added to the \Magento_Ui\web\js\lib\validation\rules.js files within my custom Theme. Preferably I'd like to use this same rule for validation within the edit page (relative path: /customer/address/edit/id/[XXX]/).

Unfortunately most information seems to be about the checkout page, not for the additional forms where addresses can be edited.

1 Answer 1


I recommend to take a look at this GitHub module



Mage2 Module Experius AddressLines,

Adds labels to address lines and adds configuration per address line.

Configuration Per Line (Required Entry Yes/No, Label and Validation Classes)

Stores > Configuration > Customers > Customer Configuration > Address Lines

This module also works on the Customer Account Address Edit pages and if you enable the Address to Display on the Customer Registration Page it will also show there.

For more information how to Display the Address on the Customer Registration Page take a look at this blog article I wrote https://codeblog.experius.nl/magento-2-address-fields-customer-registration/

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.