Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
No related merge requests found
Pipeline #38697 passed
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment