Commit 3690f78f authored by Florian Joriot's avatar Florian Joriot
Browse files

Modif select multiple (correction plusieurs texte complementaire)

parent 973da212
Loading
Loading
Loading
Loading
Loading
+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
@@ -15,7 +15,7 @@ $reponse = explode(':::', $reponse);
            <?php echo $champ->getLibelle(); ?>&nbsp;:
        </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); ?>"
@@ -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>