diff --git a/module/form/form.php b/module/form/form.php index db05a96c..fb6408b1 100644 --- a/module/form/form.php +++ b/module/form/form.php @@ -68,6 +68,12 @@ class form extends common { // Soumission du formulaire if($this->isPost()) { // Configuration + // Option sélectionnée sans page choisie + $pageId = ''; + if ($this->getInput('formConfigPageId', helper::FILTER_ID) !== null) { + // Option désactivée, réinitialiser l'id de la page sélectionnée. + $pageId = $this->getInput('formConfigPageIdToggle', helper::FILTER_BOOLEAN) === true ? $this->getInput('formConfigPageId', helper::FILTER_ID) : ''; + } $this->setData([ 'module', $this->getUrl(0), @@ -78,7 +84,7 @@ class form extends common { 'group' => $this->getInput('formConfigGroup', helper::FILTER_INT), 'user' => self::$listUsers [$this->getInput('formConfigUser', helper::FILTER_INT)], 'mail' => $this->getInput('formConfigMail') , - 'pageId' => $this->getInput('formConfigPageId', helper::FILTER_ID), + 'pageId' => $pageId, 'subject' => $this->getInput('formConfigSubject') ] ]); diff --git a/module/form/view/config/config.js.php b/module/form/view/config/config.js.php index 41a9fbbb..94175ae4 100644 --- a/module/form/view/config/config.js.php +++ b/module/form/view/config/config.js.php @@ -158,6 +158,8 @@ $("#formConfigPageIdToggle").on("change", function() { else { $("#formConfigPageIdWrapper").slideUp(function() { $("#formConfigPageId").val(""); + console.log($("#formConfigPageId").val()); }); } -}).trigger("change"); \ No newline at end of file +}).trigger("change"); +