diff --git a/workflow/engine/templates/pmTables/edit.js b/workflow/engine/templates/pmTables/edit.js index 204b9aa3a..5d66ffbcb 100644 --- a/workflow/engine/templates/pmTables/edit.js +++ b/workflow/engine/templates/pmTables/edit.js @@ -186,9 +186,19 @@ Ext.onReady(function(){ xtype: 'textfield', allowBlank: true, listeners:{ - change: function(f,e){ - this.setValue(this.getValue().replace(/\s/g,'').toUpperCase()); + change: function(f,e){ + this.setValue(this.getValue().replace(/^\s+/,'').replace(/\s+$/,'')); + var valueInputField= /^[0-9a-zA-Z\_]+$/.test(this.getValue()) ? true : false; + if (valueInputField) { + this.setValue(this.getValue().replace(/\s/g,'').toUpperCase()); + }else{ + //Ext.Msg.alert(_('ID_WARNING'), _('ID_FIELD_NAME')); + this.setValue(''); + } } + }, + validator: function(v) { + return valueInputField= /^[0-9a-zA-Z\_]+$/.test(v)?true:false; } } }, { @@ -198,7 +208,20 @@ Ext.onReady(function(){ width: 220, editor:{ xtype: 'textfield', - allowBlank: true + allowBlank: true, + listeners:{ + change: function(f,e){ + this.setValue(this.getValue().replace(/^\s+/,'').replace(/\s+$/,'')); + var valueInputField= /^[0-9a-zA-Z\_]+$/.test(this.getValue()) ? true : false; + if (!valueInputField) { + //Ext.Msg.alert(_('ID_WARNING'), _('ID_FIELD_LABEL')); + this.setValue(''); + } + } + }, + validator: function(v) { + return valueInputField= /^[0-9a-zA-Z\_]+$/.test(v)?true:_('ID_ROLE_NAME_NOT_EMPTY'); + } } }, { id: 'field_type',