From 1d00f7dad3e41ed31abbe23b912441abdc0a1224 Mon Sep 17 00:00:00 2001 From: shachar058 Date: Wed, 16 Nov 2016 10:53:24 +0200 Subject: [PATCH] Sz/saving hidden field dem (#347) * fixed bug: when fields are hidden in demographics editing, wouldn't clear them when saving --- library/validation/validation_script.js.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/library/validation/validation_script.js.php b/library/validation/validation_script.js.php index c4014fc1f..8bf26537a 100644 --- a/library/validation/validation_script.js.php +++ b/library/validation/validation_script.js.php @@ -82,9 +82,10 @@ function submitme(new_validate,e,form_id, constraints) { element = $('[name="'+ key + '"]'); if(!$(element).is('select[multiple]')) { - if($(element).parent().prop('style') != undefined && $(element).parent().prop('style').visibility == 'hidden'){ - $(element).val(""); - } + if($(element).parent().prop('style') != undefined && ($(element).parent().prop('style').visibility == 'hidden'|| element.parent().parent().css('display')== 'none')){ + $(element).val(""); + } + } } -- 2.11.4.GIT