[Vtigercrm-commits] [vtiger-commits] r9545 - /vtigercrm/branches/5.0.1/Smarty/templates/Settings/PickList.tpl
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Fri Sep 29 13:58:55 EDT 2006
Author: richie
Date: Fri Sep 29 11:58:43 2006
New Revision: 9545
Log:
Duplicate validation done for the picklist entries -- By Don
Modified:
vtigercrm/branches/5.0.1/Smarty/templates/Settings/PickList.tpl
Modified: vtigercrm/branches/5.0.1/Smarty/templates/Settings/PickList.tpl
==============================================================================
--- vtigercrm/branches/5.0.1/Smarty/templates/Settings/PickList.tpl (original)
+++ vtigercrm/branches/5.0.1/Smarty/templates/Settings/PickList.tpl Fri Sep 29 11:58:43 2006
@@ -217,8 +217,33 @@
}
);
}
+
function picklist_validate(mode,fieldname,module,uitype)
{
+
+ //alert(trim($("picklist_values").value));
+
+ var pick_arr=new Array();
+ pick_arr=trim($("picklist_values").value).split('\n');
+ var len=pick_arr.length;
+ for(i=0;i<len;i++)
+ {
+ var valone;
+ curr_iter = i;
+ valone=pick_arr[curr_iter];
+ for(j=curr_iter+1;j<len;j++)
+ {
+ var valnext;
+ valnext=pick_arr[j];
+ if(trim(valone) == trim(valnext))
+ {
+ alert("Duplicate entries found for the value '"+valone+"'");
+ return false;
+ }
+ }
+ i = curr_iter
+
+ }
if(mode == 'edit')
{
if(trim($("picklist_values").value) == '')
More information about the vtigercrm-commits
mailing list