From 76e0d1d4e6f6627104352f2c5007afaaffd240b5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 16 Feb 2023 21:53:38 +0100 Subject: [PATCH] Fix reload of page --- htdocs/fourn/facture/card.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 2c1f8156d92..099843308d4 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2247,10 +2247,9 @@ if ($action == 'create') { $(document).ready(function() { $("#fac_rec").change(function() { console.log("We have changed the template invoice - Reload page"); - var fac_rec = $(this).val(); - var socid = $(\'#socid\').val(); - // For template invoice change, we must reuse data of template, not input already done, so we call a GET with action=create, not a POST submit. - window.location.href = "'.$_SERVER["PHP_SELF"].'?action=create&socid="+socid+"&fac_rec="+fac_rec; + // reload page + $("input[name=action]").val("create"); + $("form[name=add]").submit(); }); }); ';