Commit 70785b4c authored by Florian Joriot's avatar Florian Joriot
Browse files

Modif select multiple (correction plusieurs texte complementaire)

parent 424fb998
Loading
Loading
Loading
Loading
Loading
+15 −3
Changes for view/unicaen-autoform/formulaire/modifier-champ.phtml: 15 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -25,20 +25,32 @@ use UnicaenAutoform\Form\Champ\ChampForm;
    </ul>
</div>

<div class="infos" id="<?php echo Champ::TYPE_SELECT_TEXT; ?>">
    <strong>Multiples champs parametrable</strong>
    <br/>
    Le libellé sera utilisé comme entête du champ.
    Les élements sont à renseigner dans la partie option et séparer d'un [;].
    Les types d'élément connus sont :
    <ul>
        <li> texte court : texte court|Le libellé du texte court ; </li>
        <li> texte long : texte long|Le libellé du texte court ; </li>
        <li> select : select|Le libellé du select|option 1|option 2| ... . </li>
    </ul>
</div>

<script>
    $(document).ready(function() {
        $("div.infos").hide();

        let selected = $('select#type option:selected').val();
        $("span#"+ selected).show();
        $("div#"+ selected).show();
    });

    $('select#type').change(function() {
        let selected = $('select#type option:selected').val();
        alert("changes !" + selected);

        $("span.infos").hide();
        $("span#"+ selected).show();
        $("div.infos").hide();
        $("div#"+ selected).show();
    });
</script>
 No newline at end of file