3

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.

asked Jul 8, 2017 at 10:45

1 Answer 1

1

I recommend to take a look at this GitHub module

https://github.com/experius/Magento-2-Module-Experius-Address-Lines

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/

Rohan Hapani
17.6k9 gold badges57 silver badges99 bronze badges
answered Jul 8, 2017 at 12:18

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.