Преглед изворни кода

Bug fix: validation was broken when the first fields were not Ok.

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@2806 a333f486-631f-4898-b8df-5754b55c2be0
dflaven пре 12 година
родитељ
комит
77dd93462a
1 измењених фајлова са 4 додато и 1 уклоњено
  1. 4 1
      js/property_field.js

+ 4 - 1
js/property_field.js

@@ -265,7 +265,10 @@ function ValidateWithPattern(sFieldId, bMandatory, sPattern, sFormId, aForbidden
 		$('#'+sFieldId).removeAttr('title');
 		// Remove the element from the array 
 		iFieldIdPos = oFormValidation[sFormId].indexOf(sFieldId);
-		oFormValidation[sFormId].splice(iFieldIdPos, 1);
+		if (iFieldIdPos > -1)
+		{
+			oFormValidation[sFormId].splice(iFieldIdPos, 1);			
+		}
 	}
 }