MAGENTO 1.X – NO PO BOX IN SHIPPING AND/OR BILLING ADDRESS


In some cases, people adds his PO Box number to the shipping or billing address. To Make a restriction on that, you need to add the following Magento Validation script on the corresponding phtml, as follows:


Also, you need to add on the corresponding <input> the class no-po-box to let the script recognize the regular expression.

If you want to make this validation on the checkout shipping / billing input fields, you need to change the following files:


Then you can make a try and you should see the validation in there.

Note: This kind of validations are useful for any input text. You can change the regular expression whenever you want, and assign the Validation to the input class in the corresponding phtml.