diff app/view/form/Probe.js @ 671:08e3e7b80a34

Deskriptor validation with Regex
author Dustin Demuth <dustin@intevation.de>
date Fri, 20 Mar 2015 11:25:48 +0100
parents 05e4ad93d021
children f373446325b4
line wrap: on
line diff
--- 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,

http://lada.wald.intevation.org