Kaynağa Gözat

Portal : Request template OQL list fields marked as mandatory were not validated properly

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@4371 a333f486-631f-4898-b8df-5754b55c2be0
glajarige 8 yıl önce
ebeveyn
işleme
dbfd703595
1 değiştirilmiş dosya ile 6 ekleme ve 0 silme
  1. 6 0
      js/form_field.js

+ 6 - 0
js/form_field.js

@@ -131,6 +131,7 @@ $(function()
 				}
 				
 				var bMandatory = (this.options.validators.mandatory !== undefined);
+				var bNotEmptyExtKey = (this.options.validators.notemptyextkey !== undefined);
 				var bEmpty = ($.isArray(oValue)) ? (oValue.length === 0) : (oValue === '' || oValue === undefined);
 				var value = oValue;
 				
@@ -142,6 +143,11 @@ $(function()
 					oResult.is_valid = false;
 					oResult.error_messages.push(this.options.validators.mandatory.message);
 				}
+				else if( bEmpty && bNotEmptyExtKey )
+				{
+					oResult.is_valid = false;
+					oResult.error_messages.push(this.options.validators.notemptyextkey.message);
+				}
 				// ... Field empty but not mandatory, no need to validate
 				else if( bEmpty && !bMandatory )
 				{