Prevent Shipping To Po Box?

In version 2 on cs cart someone did it. Here is link

http://forum.cs-cart.com/topic/16421-prevent-shipping-to-po-box-how-to/

I was hoping this version can do it.

Magento has it. there has to be away to do it.

Did you try the mentioned code on 4.x version? It does not look like too complex changes are required to adapt it to the current core.js file

Where is the core js file located? Never mind I found it

Ok not sure what the user data is for address. I seen this in profile_info.tpl

{include file="views/profiles/components/profile_fields_info.tpl" fields=$profile_fields.B title=__("billing_address")}

This line:
if(elm.attr("name") == "user_data[b_address]") {
would this be changed to:
if(elm.attr("name") == "profile_fields.B title=__("billing_address")) {
What I have so far:
 // Billing address first line
                      if(elm.attr("name") == "user_data[b_address]") {
                       if (lbl.hasClass('cm-required') || $.is.blank(elm.val()) == false) {
                                        if($('#sa').css('display') !== "block") {
                                                if(elm.val().indexOf( 'po box' ) !== -1 || elm.val().indexOf( 'PO Box' ) !== -1 || elm.val().indexOf( 'P.O. $
                                                                this.form_message("Cannot ship to a PO Box", lbl);
                                                                is_ok = false;
                                                                set_mark = true;
                                                }
                                        }
                                }
                        }
                 // Shipping address first line
                 if(elm.attr("name") == "user_data[s_address]") {
                 if (lbl.hasClass('cm-required') || $.is.blank(elm.val()) == false) {
                                            if(elm.val().indexOf( 'po box' ) !== -1 || elm.val().indexOf( 'PO Box' ) !== -1 || elm.val().indexOf( 'P.O. $
                                                            this.form_message("Cannot ship to a PO Box", lbl);
                                                            is_ok = false;
                                                            set_mark = true;
                                            }
                                    }
                            }

Where is the core js file located? Never mind I found it

Hello!

core.js file is located in the js/tygh/ folder.

What I have so far:

Does it work as required?

What u mean does it work as required? I tried it and does nothing not sure where to put this at in the core is file or maybe do I put it in checkout tpl file