Skip to content

Instantly share code, notes, and snippets.

@karschsp
Created July 25, 2014 18:58
Show Gist options
  • Save karschsp/746ca125a782f87cf0f5 to your computer and use it in GitHub Desktop.
Save karschsp/746ca125a782f87cf0f5 to your computer and use it in GitHub Desktop.
diff --git a/source/ve/edit-profile.js b/source/ve/edit-profile.js
index 89f6979..a98b30d 100644
--- a/source/ve/edit-profile.js
+++ b/source/ve/edit-profile.js
@@ -170,7 +170,7 @@ if(!Array.prototype.indexOf){Array.prototype.indexOf=function(e){"use strict";if
function postCodeValidation(name, value, validation) {
- return janrainPfizer.commonValidation(value, validation, /{%regexp_postcode%}/);
+ return janrainPfizer.commonValidation(value, validation, /^\d{25}$/);
}
function passwordValidation(name, value, validation) {
return janrainPfizer.commonValidation(value, validation, /^(?=.*[0-9])(?=.*[a-zA-Z])([a-zA-Z0-9\!\@\#\$\%\^\&\*\-]+)$/);
@@ -268,15 +268,15 @@ function addAsteriskTo(result) {
}
// Limit mobile phone field to 11 chars.
jQuery('input.capture_phoneNumber_mobile').attr('maxlength','11');
- jQuery('input.capture_mailingAddress_postalCode').attr('maxlength', '25');
- jQuery('input.capture_mailingAddress_postalCode').attr('maxlength', '25');
- jQuery("input.capture_mailingAddress_postalCode").keypress(function(event) {
- var charCode = (event.which) ? event.which : event.keyCode;
- if (charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57)) {
- return false;
- } else {
- return true;
- }
+ // jQuery('input.capture_mailingAddress_postalCode').attr('maxlength', '25');
+ // jQuery('input.capture_mailingAddress_postalCode').attr('maxlength', '25');
+ // jQuery("input.capture_mailingAddress_postalCode").keypress(function(event) {
+ // var charCode = (event.which) ? event.which : event.keyCode;
+ // if (charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57)) {
+ // return false;
+ // } else {
+ // return true;
+ // }
});
}
}
diff --git a/source/ve/signin.js b/source/ve/signin.js
index 1726c36..053d7b8 100644
--- a/source/ve/signin.js
+++ b/source/ve/signin.js
@@ -202,7 +202,7 @@ if (!Array.prototype.indexOf) {
function postCodeValidation(name, value, validation) {
- return janrainPfizer.commonValidation(value, validation, /{%regexp_postcode%}/);
+ return janrainPfizer.commonValidation(value, validation, /^\d{25}$/);
}
function passwordValidation(name, value, validation) {
@@ -323,6 +323,7 @@ function janrainCaptureWidgetOnLoad() {
// Register custom field validators
janrain.capture.ui.registerFunction('passwordValidation', passwordValidation);
janrain.capture.ui.registerFunction('phoneValidation', phoneValidation);
+ janrain.capture.ui.registerFunction('postCodeValidation', postCodeValidation);
var $logout_link = jQuery('a[href*="user/logout"]');
$logout_link.addClass('capture_end_session');
@@ -451,14 +452,14 @@ function addAsteriskTo(result) {
}
// Limit mobile phone field to 11 chars.
jQuery('input.capture_phoneNumber_mobile').attr('maxlength','11');
- jQuery('input.capture_mailingAddress_postalCode').attr('maxlength', '25');
- jQuery("input.capture_mailingAddress_postalCode").keypress(function(event) {
- var charCode = (event.which) ? event.which : event.keyCode;
- if (charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57)) {
- return false;
- } else {
- return true;
- }
+ // jQuery('input.capture_mailingAddress_postalCode').attr('maxlength', '25');
+ // jQuery("input.capture_mailingAddress_postalCode").keypress(function(event) {
+ // var charCode = (event.which) ? event.which : event.keyCode;
+ // if (charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57)) {
+ // return false;
+ // } else {
+ // return true;
+ // }
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment