uknutz Posted August 16, 2015 Share Posted August 16, 2015 (edited) First off not sure if this is the right place to post so please move if required. I spent 3 hours working this stupid oversight out so I hope it helps any UK users with the same issue. Have spent 3 hours trying to get a simple Postcode entry on a UK address and no matter what I did it would always show an error, even though I set the format field empty so not to validate. The reason why is the field is forced uppercase so you need to edit the following file js/validate.js and find function validate_isPostCode(s, pattern, iso_code) { if (typeof iso_code === 'undefined' || iso_code == '') iso_code = '[A-Z]{2}'; if (typeof(pattern) == 'undefined' || pattern.length == 0) pattern = '[a-z 0-9-]+'; and change it to function validate_isPostCode(s, pattern, iso_code) { if (typeof iso_code === 'undefined' || iso_code == '') iso_code = '[A-Z]{2}'; if (typeof(pattern) == 'undefined' || pattern.length == 0) pattern = '[a-zA-Z 0-9-]+'; Now it will validate uppercase letters. Edited August 16, 2015 by uknutz (see edit history) 3 Link to comment Share on other sites More sharing options...
CoffeePods Posted January 28, 2016 Share Posted January 28, 2016 Super important fix! Should be implemented in Prestashop!!!!!! Link to comment Share on other sites More sharing options...
iza997 Posted July 11, 2016 Share Posted July 11, 2016 I still cannot enter any UK postcode. Both upper and lower case letters are "refused" and I always receive the error message:*Required field postcode form box code: <div class="required postcode form-group form-error"> <label for="postcode">Zip/Postal Code <sup>*</sup></label> <input class="is_required validate form-control" data-validate="isPostCode" type="text" id="postcode" name="postcode" value=""> </div> I've modified js as explained 2 posts above. Link to comment Share on other sites More sharing options...
iza997 Posted July 12, 2016 Share Posted July 12, 2016 (edited) One more time me. There is a solution to this problem, "brutal" though. It is enough to modify function validate_isPostCode and put return true; between the brackets. Mentioned function can be found in file js/validate.js There is one danger! EVERYTHING CAN BE PLACED IN THE BOX!Anybody with skill could talk to me about it? I need to know something about variables: s, pattern, iso_code. PLEASE Edited July 12, 2016 by iza997 (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now