I need a javascript form validation to detect the entry of what would appear to be a PO Box in a Street Address field. We use UPS for shipping and they can't deliver to a PO Box. I would like to know how to detect any of the following entries as the start of the address entry (not case sensitive):
PO Box
P.O.
P O Box
P. O.
I know there are other possibilities, but this would detect 90% of the PO Box address entries and this doesn't have to be completely foolproof.
If one of the strings above is detected, I would like to give the user an alert message with an option to continue (override the warning) with the address as entered. I would like the alert message to say:
"It appears that you have entered a PO Box in the Street Address field and UPS is unable to deliver to a PO Box."
and offer 2 buttons:
Change Address - return to form with focus on Address field
Continue Anyway - submit the form without making any changes
I would like this be added to the end of my current validation script as the last check before the form is submitted.
THANKS!! in advance for your help with this.
PO Box
P.O.
P O Box
P. O.
I know there are other possibilities, but this would detect 90% of the PO Box address entries and this doesn't have to be completely foolproof.
If one of the strings above is detected, I would like to give the user an alert message with an option to continue (override the warning) with the address as entered. I would like the alert message to say:
"It appears that you have entered a PO Box in the Street Address field and UPS is unable to deliver to a PO Box."
and offer 2 buttons:
Change Address - return to form with focus on Address field
Continue Anyway - submit the form without making any changes
I would like this be added to the end of my current validation script as the last check before the form is submitted.
THANKS!! in advance for your help with this.
Comment