Loading src/UnicaenAutoform/View/Helper/partial/input/select_text.phtml +5 −5 Changes for src/UnicaenAutoform/View/Helper/partial/input/select_text.phtml: 5 added lines, 5 removed lines. Original line number Diff line number Diff line Loading @@ -15,7 +15,7 @@ $reponse = explode(':::', $reponse); <?php echo $champ->getLibelle(); ?> : </label> <div class="col-sm-9"> <select class="form-control" name="<?php echo $champ->getId(); ?>" id="<?php echo $champ->getId(); ?>" onchange="showComplement(this.value)"> <select class="form-control" name="<?php echo $champ->getId(); ?>" id="<?php echo $champ->getId(); ?>" onchange="showComplement(this.value, this.name)"> <option value="null"></option> <?php foreach ($options as $option) : ?> <option id="<?php echo trim($option); ?>" value="<?php echo trim($option); ?>" Loading Loading @@ -45,17 +45,17 @@ $reponse = explode(':::', $reponse); <script> function showComplement(option) function showComplement(option, name) { console.log(option.substring(option.length - 1)); if (option !== "") { if (option.substring(option.length - 1) === '*') { document.getElementById("text_complementaire"+option.value).style.display = ''; document.getElementById("text_complementaire_"+name).style.display = ''; } else { document.getElementById("text_complementaire"+option.value).style.display = 'none'; document.getElementById("text_complementaire_"+name).style.display = 'none'; } } else { document.getElementById("text_complementaire"+option.value).style.display = 'none'; document.getElementById("text_complementaire_"+name).style.display = 'none'; } } </script> Loading Loading
src/UnicaenAutoform/View/Helper/partial/input/select_text.phtml +5 −5 Changes for src/UnicaenAutoform/View/Helper/partial/input/select_text.phtml: 5 added lines, 5 removed lines. Original line number Diff line number Diff line Loading @@ -15,7 +15,7 @@ $reponse = explode(':::', $reponse); <?php echo $champ->getLibelle(); ?> : </label> <div class="col-sm-9"> <select class="form-control" name="<?php echo $champ->getId(); ?>" id="<?php echo $champ->getId(); ?>" onchange="showComplement(this.value)"> <select class="form-control" name="<?php echo $champ->getId(); ?>" id="<?php echo $champ->getId(); ?>" onchange="showComplement(this.value, this.name)"> <option value="null"></option> <?php foreach ($options as $option) : ?> <option id="<?php echo trim($option); ?>" value="<?php echo trim($option); ?>" Loading Loading @@ -45,17 +45,17 @@ $reponse = explode(':::', $reponse); <script> function showComplement(option) function showComplement(option, name) { console.log(option.substring(option.length - 1)); if (option !== "") { if (option.substring(option.length - 1) === '*') { document.getElementById("text_complementaire"+option.value).style.display = ''; document.getElementById("text_complementaire_"+name).style.display = ''; } else { document.getElementById("text_complementaire"+option.value).style.display = 'none'; document.getElementById("text_complementaire_"+name).style.display = 'none'; } } else { document.getElementById("text_complementaire"+option.value).style.display = 'none'; document.getElementById("text_complementaire_"+name).style.display = 'none'; } } </script> Loading