From e9ef48b79c4a7e1c4a73d90b92d30c838e1b8177 Mon Sep 17 00:00:00 2001 From: Eric Espie Date: Wed, 3 Jul 2024 09:28:18 +0200 Subject: [PATCH] =?UTF-8?q?N=C2=B07559=20-=20Fix=20radio=20buttons=20in=20?= =?UTF-8?q?template=20fields?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/form_field.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/js/form_field.js b/js/form_field.js index 9e19b57b8..908d823ae 100644 --- a/js/form_field.js +++ b/js/form_field.js @@ -97,9 +97,15 @@ $(function() } else if( $(oElem).is(':radio')) { - if($(oElem).is(':checked')) + let nameRadioButton= $(oElem).prop('name'); + let radioCheckProp = $('[name='+nameRadioButton+']:checked'); + if(radioCheckProp.length === 1) { - value =$(oElem).val(); + value = radioCheckProp.val(); + } + else + { + value = ""; } } else if($(oElem).is(':checkbox'))