If an address polo Rd is given, it identifies "po" in polo and alerts error message.
So, we should frame a new validation which should not accept address lines 1 and 2 with the values:
- "PO BOX", "PO BIN", "BIN", "P.O BOX", "P.O BIN", "P.O", "PO"
- the above values can be in any case
- spaces before, in between and after the above words should also be found and validated. For example: " P O 1234 " should be validated and alert error message.
- But "Polo Rd", "Robin Rd", "testbintest" should be accepted as valid address in both the address lines
the code which is writen for this is
jQuery.validator.addMethod("nopobox", function(value, element) {
return this.optional(element) || ! /(P(OST)?\.?\s*O(FF(ICE)?)?\.?\s*((BOX)|(BIN)))|(^[^0-9]*((P(OST)?\.?\s*O(FF(ICE)?)?\.?)|((BOX)|(BIN))))/i.test(value);
}, "");
Please let me know how I can change it