From 506d80971232ead691d13fd2416165352ab6148b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 16 Jan 2021 17:50:02 +0100 Subject: [PATCH] FIX #15991 --- htdocs/core/class/html.form.class.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 9447c205640..a8b9bab087b 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4419,10 +4419,15 @@ class Form if (inputok.length>0) { $.each(inputok, function(i, inputname) { var more = ""; - if ($("#" + inputname).attr("type") == "checkbox") { more = ":checked"; } - if ($("#" + inputname).attr("type") == "radio") { more = ":checked"; } - var inputvalue = $("#" + inputname + more).val(); + var inputvalue; + if ($("input[name=\'" + inputname + "\']").attr("type") == "radio") { + inputvalue = $("input[name=\'" + inputname + "\']").val(); + } else { + if ($("#" + inputname).attr("type") == "checkbox") { more = ":checked"; } + inputvalue = $("#" + inputname + more).val(); + } if (typeof inputvalue == "undefined") { inputvalue=""; } + console.log("check inputname="+inputname+" inputvalue="+inputvalue); options += "&" + inputname + "=" + encodeURIComponent(inputvalue); }); }