Commit 4ac9f1b2 authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

Correction du problème de détermination de l'élément maximal

parent c44bcd8d
Loading
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -79,7 +79,7 @@ $array = "[" . implode(",", $temp) . "]";
    $(function () {
        let optionsText = '<?php echo $champ->getOptions(); ?>';
        let fields = readOptions(optionsText);
        let reponses = "<?php echo str_replace(["'",'"'],["\'", '\"'],$reponse); ?>";
        let reponses = "<?php echo $reponse?str_replace(["'",'"'],["\'", '\"'],$reponse):""; ?>";

        let dictionnary = [];
        let blob = reponses.split('|');
@@ -122,7 +122,7 @@ $array = "[" . implode(",", $temp) . "]";

        let maximum = 0;
        for (let i = 0; i < elements.length; i++) {
            let thisId = elements[i].id.split("_")[2];
            let thisId = Number(elements[i].id.split("_")[2]);
            if (thisId > maximum) maximum = thisId;
        }
        return maximum;
@@ -133,7 +133,6 @@ $array = "[" . implode(",", $temp) . "]";
    function ajouter_PlusCustom(sid, fields, responses) {
        // console.log(fields);
        let id = sid;

        let maximum = getMaxElements(id);
        let position = Number(maximum) + 1;
        let element_id = 'element_' + id + '_' + position;