[Lada-commits] [PATCH] Deskriptor validation with Regex

Wald Commits scm-commit at wald.intevation.org
Fri Mar 20 11:08:41 CET 2015


# HG changeset patch
# User Dustin Demuth <dustin at intevation.de>
# Date 1426847148 -3600
# Node ID 08e3e7b80a34592ef6ae3c1b8cd5710d89d07876
# Parent  2927abe98b66934095341668f5be639ba7b365e8
Deskriptor validation with Regex

diff -r 2927abe98b66 -r 08e3e7b80a34 app/view/form/Probe.js
--- a/app/view/form/Probe.js	Thu Mar 19 15:44:17 2015 +0100
+++ b/app/view/form/Probe.js	Fri Mar 20 11:25:48 2015 +0100
@@ -179,10 +179,14 @@
                             }
                         }, {
                             xtype: 'textfield',
-                            maxLength: 100,
+                            maxLength: 38,
+                            enforceMaxLength: true,
                             name: 'mediaDesk',
                             labelWidth: 125,
                             fieldLabel: 'Deskriptoren',
+                            regex: new RegExp('(?:D: ){1}(?:[0-9]{2} ){11}[0-9]{2}'),
+                            regexText: 'Die Deskriptoren haben das falsche Format.<br />'+
+                            'Richtig wäre: D: 99 99 99 99 99 99 99 99 99 99 99 99',
                             listeners: {
                                 dirtychange: {
                                     fn: this.updateOnChange,


More information about the Lada-commits mailing list