From 2a9deb2feaefb03cd0bb4e15756e35b7f22edbea Mon Sep 17 00:00:00 2001 From: Carlos Pacha Date: Wed, 23 Mar 2011 11:20:10 -0400 Subject: [PATCH] bug: you can create a triggers with spaces after a before the name, this bug was fixed, we are removing the spaces after and before the string --- workflow/engine/xmlform/triggers/triggers_Options.xml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/workflow/engine/xmlform/triggers/triggers_Options.xml b/workflow/engine/xmlform/triggers/triggers_Options.xml index b5b2dade6..5c157b3f8 100644 --- a/workflow/engine/xmlform/triggers/triggers_Options.xml +++ b/workflow/engine/xmlform/triggers/triggers_Options.xml @@ -103,7 +103,10 @@ @#PAGED_TABLE_ID.refresh(); } } - + //with this function, we are removing the spaces after and before of a string + String.prototype.trim = function() { + return this.replace(/^\s+|\s+$/g, ""); + }; //for trigger no wizard function triggerSave1(form) { @@ -112,10 +115,10 @@ var triUid = getField('TRI_UID').value; } if(triUid==''){ - var triTitle =getField('TRI_TITLE').value; + var triTitle =getField('TRI_TITLE').value.trim(); if(triTitle==''){ alert(G_STRINGS.ID_REQUIRED_NAME_TRIGGERS);return false; - } + } reqName=ajax_function("../triggers/triggers_Save",'lookforNameTrigger','NAMETRIGGER='+encodeURIComponent(triTitle)+'&proUid='+(getField('PRO_UID').value),'POST') ; if(!reqName){ alert(G_STRINGS.ID_EXIST_TRIGGERS);return false;