You need to do this by overiding the phtml file into your custom extension.
- Create
customer_address_form.xml on the following locations.
app/code/VENDOR/EXTENSION/view/frontend/layout/customer_address_form.xml
add this code :
<?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="customer_account"/> <body> <referenceBlock name="customer_address_edit"> <action method="setTemplate"> <argument name="template" xsi:type="string">VENDOR_EXTENSION::address/edit.phtml</argument> </action> </referenceBlock> </body> </page>
- Now you need to copy
edit.phtml file and put into your extension.
Copy from : vendor/magento/module-customer/view/frontend/templates/address/edit.phtml
To : app/code/VENDOR/EXTENSION/view/frontend/templates/address/edit.phtml
- Now you need to apply custom validation into your overide files.
app/code/VENDOR/EXTENSION/view/frontend/templates/address/edit.phtml