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; }