Jelajahi Sumber

Prevent the JS validation (on focus) to create multiple entries for the same field, since it breaks the validation.

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@3421 a333f486-631f-4898-b8df-5754b55c2be0
dflaven 10 tahun lalu
induk
melakukan
9fe25b7b1f
1 mengubah file dengan 5 tambahan dan 1 penghapusan
  1. 5 1
      js/property_field.js

+ 5 - 1
js/property_field.js

@@ -266,7 +266,11 @@ function ValidateWithPattern(sFieldId, bMandatory, sPattern, sFormId, aForbidden
 	if (!bValid)
 	{
 		$('#v_'+sFieldId).addClass('ui-state-error');
-		oFormValidation[sFormId].push(sFieldId);
+		iFieldIdPos = jQuery.inArray(sFieldId, oFormValidation[sFormId]);
+		if (iFieldPos == -1)
+		{
+			oFormValidation[sFormId].push(sFieldId);			
+		}
 		if (sMessage)
 		{
 			$('#'+sFieldId).attr('title', sMessage).tooltip();