Jump to content

Postcode Displayed As Incorrect In Adress Page


Recommended Posts

Hello,

 

When I put my postcode in the adress creation page, it gets a red border with a red cross, even if it's correct.

 

I tried to search for the reason, and the only related function I found is

function validate_isPostCode(s, pattern, iso_code)

in /www/js/validate.js, but when I changed the return value to be always true, it kept telling me my postcode was incorrect.

 

I'm litterally helpless on this one.

 

Here is the html code for this field :

<input class="is_required validate form-control uniform-input text" data-validate="isPostCode" id="postcode" name="postcode" value="" type="text">

Does anyone here knows where this check is done ? How I can correct it ?

 

Edit : I already set my postcode to be NNNNN in the country I'm using, and I tried combinations of 5 numbers only.

Edited by T.Baron (see edit history)
Link to comment
Share on other sites

I found a bug in 1.6.1.1. You need to change the validate_field method. About line 190
 

if (typeof(countriesNeedZipCode[id_country]) != 'undefined' && typeof(countries[id_country]) != 'undefined')
var result = window['validate_'+$(that).attr('data-validate')]($(that).val(), countriesNeedZipCode[id_country], countries[id_country]['iso_code']);

It needs to be like this
Link to comment
Share on other sites

  • 2 weeks later...
×
×
  • Create New...