aboutsummaryrefslogtreecommitdiffstats
path: root/web/cobrands/fixmystreet.com/js.js
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2015-07-31 14:15:09 +0100
committerMatthew Somerville <matthew@mysociety.org>2015-07-31 14:15:09 +0100
commitf929b3f79d3d3eea3a4a284a221b3106957a6fc9 (patch)
treeddd488e8f9b8172432bda5bc95dcef7b11faee2c /web/cobrands/fixmystreet.com/js.js
parent0d65707e831bacc272db6dd2ce539de57e412033 (diff)
parent392052bfdaae702af2e8e8215a63fa2f390e5769 (diff)
Merge branch 'issues/#805-name-check-cobrand'
Diffstat (limited to 'web/cobrands/fixmystreet.com/js.js')
-rw-r--r--web/cobrands/fixmystreet.com/js.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/web/cobrands/fixmystreet.com/js.js b/web/cobrands/fixmystreet.com/js.js
new file mode 100644
index 000000000..3abba8e33
--- /dev/null
+++ b/web/cobrands/fixmystreet.com/js.js
@@ -0,0 +1,3 @@
+jQuery.validator.addMethod('validName', function(value, element) {
+ var validNamePat = /\ba\s*n+on+((y|o)mo?u?s)?(ly)?\b/i;
+ return this.optional(element) || value.length > 5 && value.match( /\S/ ) && value.match( /\s/ ) && !value.match( validNamePat ); }, translation_strings.category );