From 8330f3d4984ecf0d776a0f1b913f1109fe515a3a Mon Sep 17 00:00:00 2001 From: Guillaume Lajarige Date: Fri, 2 Sep 2016 12:30:41 +0000 Subject: [PATCH] Portal : Request template OQL list fields marked as mandatory were not validated properly SVN:trunk[4371] --- js/form_field.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/js/form_field.js b/js/form_field.js index 7d715e7b9..aca562252 100644 --- a/js/form_field.js +++ b/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 ) {