aboutsummaryrefslogtreecommitdiff
path: root/wqflask/wqflask/static/new/packages/ValidationPlugin/src/additional/postalCodeCA.js
diff options
context:
space:
mode:
authorzsloan2016-02-11 17:06:07 +0000
committerzsloan2016-02-11 17:06:07 +0000
commit67cf280f32ef0822b873f94f3dd103eb7101c737 (patch)
tree2596c1aea5a82ca4987212da36f1eb64cbea6549 /wqflask/wqflask/static/new/packages/ValidationPlugin/src/additional/postalCodeCA.js
parentd5b1e7966df80ec435b05770bf1b99094ed38e77 (diff)
downloadgenenetwork2-67cf280f32ef0822b873f94f3dd103eb7101c737.tar.gz
Updated jquery validation plugin, now works in IE
Fixed a couple minor html syntax erors in login_user.html and base.html Changed export button on correlation page to csvHtml5, but still has problem with commas in fields being interpreted as a new column
Diffstat (limited to 'wqflask/wqflask/static/new/packages/ValidationPlugin/src/additional/postalCodeCA.js')
-rw-r--r--wqflask/wqflask/static/new/packages/ValidationPlugin/src/additional/postalCodeCA.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/src/additional/postalCodeCA.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/src/additional/postalCodeCA.js
new file mode 100644
index 00000000..976b316c
--- /dev/null
+++ b/wqflask/wqflask/static/new/packages/ValidationPlugin/src/additional/postalCodeCA.js
@@ -0,0 +1,16 @@
+/**
+ * Matches a valid Canadian Postal Code
+ *
+ * @example jQuery.validator.methods.postalCodeCA( "H0H 0H0", element )
+ * @result true
+ *
+ * @example jQuery.validator.methods.postalCodeCA( "H0H0H0", element )
+ * @result false
+ *
+ * @name jQuery.validator.methods.postalCodeCA
+ * @type Boolean
+ * @cat Plugins/Validate/Methods
+ */
+$.validator.addMethod( "postalCodeCA", function( value, element ) {
+ return this.optional( element ) || /^[ABCEGHJKLMNPRSTVXY]\d[A-Z] \d[A-Z]\d$/.test( value );
+}, "Please specify a valid postal code" );