Conditional Action/validation to restrict shipping to a P.O Box address

I am not sure if this is the right forum to ask this. I am looking for a way to restrict customers from putting a P.O box address in the shipping information, on address field. Is there a way of doing this?

Posted: Oct 24, 2014


psychobyte on November 10, 2014

not sure if there is a module for that. I can think of a few ways to handle this.

With Javascript: add some javascript that checks the address field

Use hook_form_validate(), you can check the submitted field's value after they have submitted the form.