From 5d33f687aebae2b281dabbed8ba2c68742ccd86e Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 18 Mar 2012 14:17:10 +0100 Subject: [PATCH] Fix: change for getJSON format --- htdocs/core/ajax/vatrates.php | 8 +++++++- htdocs/core/class/html.form.class.php | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/htdocs/core/ajax/vatrates.php b/htdocs/core/ajax/vatrates.php index d987b074bc6..c4ecc36ae9b 100644 --- a/htdocs/core/ajax/vatrates.php +++ b/htdocs/core/ajax/vatrates.php @@ -49,7 +49,13 @@ if (! empty($id) && ! empty($action) && ! empty($htmlname)) $soc->fetch($id); - echo $form->load_tva('tva_tx','',$soc,$mysoc,0,0,'',true); + $return=array(); + + $return['value'] = $form->load_tva('tva_tx','',$soc,$mysoc,0,0,'',true); + $return['num'] = $form->num; + $return['error'] = $form->error; + + echo json_encode($return); } ?> diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index d6500658dd1..6a231f95f33 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3047,7 +3047,8 @@ class Form { $return.= $this->error; } - + + $this->num = $num; return $return; }