Jump to content

sangeetha

Members
  • Posts

    2
  • Joined

  • Last visited

1 Follower

About sangeetha

  • Birthday 07/30/1992

Profile Information

  • Location
    Pondicherry, India
  • Activity
    Agency

sangeetha's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Thank you for a nice solution. It works like a charm.
  2. Hello RobbieBlokeToys, Go to js/validate.js => function validate_isPostCode(s, pattern) { if (typeof(pattern) == 'undefined' || pattern.length == 0) pattern = '[a-z 0-9-]+'; else { var replacements = { ' ': '( |)', '-': '(-|)', 'N': '[0-9]', 'L': '[a-zA-Z]' }; for (var new_value in replacements) pattern = pattern.split(new_value).join(replacements[new_value]); } var reg = new RegExp('^'+pattern+'$', 'i'); return reg.test(s); } and also go to bottom of the same file:- $(document).on('focusout', 'input.validate, textarea.validate', function() { if ($(this).hasClass('is_required') || $(this).val().length) { if ($(this).attr('name') == 'postcode' && typeof(countriesNeedZipCode[$('#id_country option:selected').val()]) != 'undefined') var result = window['validate_'+$(this).attr('data-validate')]($(this).val(), countriesNeedZipCode[$('#id_country option:selected').val()]); else var result = window['validate_'+$(this).attr('data-validate')]($(this).val()) if (result) $(this).parent().removeClass('form-error').addClass('form-ok'); else $(this).parent().addClass('form-error').removeClass('form-ok'); } });
×
×
  • Create New...