What if it does not start with "PO Box .." or "PO Box"?
Example:
John Schmidt | Silver Valley PO Box 3901 | Whereswaldoville, SI. 78946
I used the onblur event for the address field to use the javascript, indexOf function to recognize input.toUpperCase "PO BOX" || "PO" that> = 0.
If none of these two searches is found, -1 is returned, otherwise it will return the starting position of the string, which will always be 0 or more.
This will provide lazy input, the "po" field, the "po field" and just as the "po field" will be recognized. I suppose you could add 'po. field ".
In any case, the condition causes an unobtrusive message to indicate that "we cannot send the PO Box address." This function does not see if it does not apply to you. Otherwise, for users, t is js or css enabled, they just see the message. The only glitch in this graceful deterioration is if the user has css but not js enabled (where they just don't see the message at all). with a solution today, but if I think of a better way, I will come back to publish it here.
source share